]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/26796 (ACATS ICE c34002a c52005 spurious storage_error)
authorJeff Law <law@redhat.com>
Tue, 28 Mar 2006 15:35:47 +0000 (08:35 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 28 Mar 2006 15:35:47 +0000 (08:35 -0700)
        PR tree-optimization/26796
        * tree-ssa-dom.c (propagate_rhs_into_lhs): Queue blocks which
        need EH edge cleanups rather than purging them immediately.
        (eliminate_degenerate_phis): Handle queued EH cleanups.

From-SVN: r112453

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

index 6a323d6c0442626b2875fdd147b0031b85b1a5f4..69f7f65f6fcbbb8c8e929eb3cacfc0f9219aa01a 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-28  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/26796
+       * tree-ssa-dom.c (propagate_rhs_into_lhs): Queue blocks which
+       need EH edge cleanups rather than purging them immediately.
+       (eliminate_degenerate_phis): Handle queued EH cleanups.
+
 2006-03-28  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-alias.c (create_sft): Initially inherit TREE_ADDRESSABLE
index db9f873669e28cf4d4e69aef7dbe2d969776ee53..31e39d80e1cf86ba25c2d687b0c7516802a6b19d 100644 (file)
@@ -2181,10 +2181,13 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
            recompute_tree_invariant_for_addr_expr (TREE_OPERAND (use_stmt, 1));
 
          /* If we cleaned up EH information from the statement,
-             remove EH edges.  I'm not sure if this happens in 
-            practice with this code, but better safe than sorry.  */
+            mark its containing block as needing EH cleanups.  */
          if (maybe_clean_or_replace_eh_stmt (use_stmt, use_stmt))
-           tree_purge_dead_eh_edges (bb_for_stmt (use_stmt));
+           {
+             bitmap_set_bit (need_eh_cleanup, bb_for_stmt (use_stmt)->index);
+             if (dump_file && (dump_flags & TDF_DETAILS))
+               fprintf (dump_file, "  Flagged to clear EH edges.\n");
+           }
 
          /* Propagation may expose new degenerate PHIs or
             trivial copy/constant propagation opportunities.  */
@@ -2392,6 +2395,10 @@ eliminate_degenerate_phis (void)
 {
   bitmap interesting_names;
 
+  /* Bitmap of blocks which need EH information updated.  We can not
+     update it on-the-fly as doing so invalidates the dominator tree.  */
+  need_eh_cleanup = BITMAP_ALLOC (NULL);
+
   /* INTERESTING_NAMES is effectively our worklist, indexed by
      SSA_NAME_VERSION.
 
@@ -2436,6 +2443,14 @@ eliminate_degenerate_phis (void)
        }
     }
 
+  /* Propagation of const and copies may make some EH edges dead.  Purge
+     such edges from the CFG as needed.  */
+  if (!bitmap_empty_p (need_eh_cleanup))
+    {
+      cfg_altered |= tree_purge_all_dead_eh_edges (need_eh_cleanup);
+      BITMAP_FREE (need_eh_cleanup);
+    }
+
   BITMAP_FREE (interesting_names);
   if (cfg_altered)
     free_dominance_info (CDI_DOMINATORS);