Patchwork Small cleanup in cleanup_cfg

login
register
mail settings
Submitter Marek Polacek
Date Jan. 29, 2013, 3:49 p.m.
Message ID <20130129154906.GB7360@redhat.com>
Download mbox | patch
Permalink /patch/216595/
State New
Headers show

Comments

Marek Polacek - Jan. 29, 2013, 3:49 p.m.
I don't see any reason why we'd want to mark BBs in this case,
changed_bbs are thrown away right after fix_loop_structure
marks them.

Regtested/bootstrapped on x86_64-linux, ok for trunk?

2013-01-29  Marek Polacek  <polacek@redhat.com>

	* cfgcleanup.c (cleanup_cfg): Don't mark affected BBs.


	Marek
Richard Guenther - Jan. 30, 2013, 10:55 a.m.
On Tue, Jan 29, 2013 at 4:49 PM, Marek Polacek <polacek@redhat.com> wrote:
> I don't see any reason why we'd want to mark BBs in this case,
> changed_bbs are thrown away right after fix_loop_structure
> marks them.
>
> Regtested/bootstrapped on x86_64-linux, ok for trunk?

Ok.

Thanks,
Richard.

> 2013-01-29  Marek Polacek  <polacek@redhat.com>
>
>         * cfgcleanup.c (cleanup_cfg): Don't mark affected BBs.
>
> --- gcc/cfgcleanup.c.mp 2013-01-29 13:53:21.740473075 +0100
> +++ gcc/cfgcleanup.c    2013-01-29 13:53:27.942491341 +0100
> @@ -3017,14 +3017,11 @@ cleanup_cfg (int mode)
>        && (changed
>           || (mode & CLEANUP_CFG_CHANGED)))
>      {
> -      bitmap changed_bbs;
>        timevar_push (TV_REPAIR_LOOPS);
>        /* The above doesn't preserve dominance info if available.  */
>        gcc_assert (!dom_info_available_p (CDI_DOMINATORS));
>        calculate_dominance_info (CDI_DOMINATORS);
> -      changed_bbs = BITMAP_ALLOC (NULL);
> -      fix_loop_structure (changed_bbs);
> -      BITMAP_FREE (changed_bbs);
> +      fix_loop_structure (NULL);
>        free_dominance_info (CDI_DOMINATORS);
>        timevar_pop (TV_REPAIR_LOOPS);
>      }
>
>         Marek

Patch

--- gcc/cfgcleanup.c.mp	2013-01-29 13:53:21.740473075 +0100
+++ gcc/cfgcleanup.c	2013-01-29 13:53:27.942491341 +0100
@@ -3017,14 +3017,11 @@  cleanup_cfg (int mode)
       && (changed
 	  || (mode & CLEANUP_CFG_CHANGED)))
     {
-      bitmap changed_bbs;
       timevar_push (TV_REPAIR_LOOPS);
       /* The above doesn't preserve dominance info if available.  */
       gcc_assert (!dom_info_available_p (CDI_DOMINATORS));
       calculate_dominance_info (CDI_DOMINATORS);
-      changed_bbs = BITMAP_ALLOC (NULL);
-      fix_loop_structure (changed_bbs);
-      BITMAP_FREE (changed_bbs);
+      fix_loop_structure (NULL);
       free_dominance_info (CDI_DOMINATORS);
       timevar_pop (TV_REPAIR_LOOPS);
     }