re PR tree-optimization/28624 (latent segfault in remove_phi_node)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Tue, 12 Dec 2006 22:45:25 +0000 (22:45 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 12 Dec 2006 22:45:25 +0000 (14:45 -0800)
2006-12-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/28624
        * tree-ssa-dom.c (eliminate_degenerate_phis): Use a temporary
        bitmap for EXECUTE_IF_SET_IN_BITMAP.

From-SVN: r119802

gcc/ChangeLog
gcc/tree-ssa-dom.c

index 531a1f90889d7191447bdbfe70731c28e24cb7fc..0e5e595601dfcb8a34cf16b18e4b31dbb54d3c90 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/28624
+       * tree-ssa-dom.c (eliminate_degenerate_phis): Use a temporary 
+       bitmap for EXECUTE_IF_SET_IN_BITMAP.
+
 2006-12-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        PR tree-opt/28436
index 7bae33ff43dee475ff8af9f790f807149ac4ad79..73ddc0a9dbacea7bf463ead39bf82dafc6079dc1 100644 (file)
@@ -2466,6 +2466,7 @@ static unsigned int
 eliminate_degenerate_phis (void)
 {
   bitmap interesting_names;
+  bitmap interesting_names1;
 
   /* Bitmap of blocks which need EH information updated.  We can not
      update it on-the-fly as doing so invalidates the dominator tree.  */
@@ -2482,6 +2483,7 @@ eliminate_degenerate_phis (void)
      Experiments have show we generally get better compilation
      time behavior with bitmaps rather than sbitmaps.  */
   interesting_names = BITMAP_ALLOC (NULL);
+  interesting_names1 = BITMAP_ALLOC (NULL);
 
   /* First phase.  Eliminate degenerate PHIs via a dominator
      walk of the CFG.
@@ -2503,7 +2505,12 @@ eliminate_degenerate_phis (void)
       unsigned int i;
       bitmap_iterator bi;
 
-      EXECUTE_IF_SET_IN_BITMAP (interesting_names, 0, i, bi)
+      /* EXECUTE_IF_SET_IN_BITMAP does not like its bitmap
+        changed during the loop.  Copy it to another bitmap and
+        use that.  */
+      bitmap_copy (interesting_names1, interesting_names);
+
+      EXECUTE_IF_SET_IN_BITMAP (interesting_names1, 0, i, bi)
        {
          tree name = ssa_name (i);
 
@@ -2524,6 +2531,7 @@ eliminate_degenerate_phis (void)
     }
 
   BITMAP_FREE (interesting_names);
+  BITMAP_FREE (interesting_names1);
   if (cfg_altered)
     free_dominance_info (CDI_DOMINATORS);
   return 0;