aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2006-03-28 08:35:47 -0700
committerJeff Law <law@gcc.gnu.org>2006-03-28 08:35:47 -0700
commit72922229b7431aac7f5ac3d207a017473dccce4d (patch)
tree07e79d2e611e6316f4cc9475baa6b19be0b12e50 /gcc/tree-ssa-dom.c
parentc245c134da2fdced8608d3e992c969ae22932752 (diff)
downloadgcc-72922229b7431aac7f5ac3d207a017473dccce4d.zip
gcc-72922229b7431aac7f5ac3d207a017473dccce4d.tar.gz
gcc-72922229b7431aac7f5ac3d207a017473dccce4d.tar.bz2
re PR tree-optimization/26796 (ACATS ICE c34002a c52005 spurious storage_error)
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
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index db9f873..31e39d8 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -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);