aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-05-16 16:14:02 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-05-16 16:14:02 -0700
commitaf47810aed761b3795572e0ae46b8c28fd09b5ee (patch)
tree33124791d9f4d0376ee20ed1b477125f15b3b1d3 /gcc/tree-eh.c
parentf59d2aade3edd34329cc69762bc7d155284b6c62 (diff)
downloadgcc-af47810aed761b3795572e0ae46b8c28fd09b5ee.zip
gcc-af47810aed761b3795572e0ae46b8c28fd09b5ee.tar.gz
gcc-af47810aed761b3795572e0ae46b8c28fd09b5ee.tar.bz2
re PR tree-optimization/21399 (libstdc++ 12077.cc ICE)
PR tree-opt/21399 * tree-eh.c (maybe_clean_or_replace_eh_stmt): Rename from maybe_clean_eh_stmt; take old stmt parameter. Update EH region data structure to match replacement. * tree-flow.h: Update to match. * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. * tree-ssa-dom.c (optimize_stmt): Likewise. * tree-ssa-pre.c (eliminate): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r99801
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 7d83746..9f641e1 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -2034,12 +2034,32 @@ tree_can_throw_external (tree stmt)
return can_throw_external_1 (region_nr);
}
-bool
-maybe_clean_eh_stmt (tree stmt)
+/* Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
+ OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
+ in the table if it should be in there. Return TRUE if a replacement was
+ done that my require an EH edge purge. */
+
+bool
+maybe_clean_or_replace_eh_stmt (tree old_stmt, tree new_stmt)
{
- if (!tree_could_throw_p (stmt))
- if (remove_stmt_from_eh_region (stmt))
- return true;
+ int region_nr = lookup_stmt_eh_region (old_stmt);
+
+ if (region_nr >= 0)
+ {
+ bool new_stmt_could_throw = tree_could_throw_p (new_stmt);
+
+ if (new_stmt == old_stmt && new_stmt_could_throw)
+ return false;
+
+ remove_stmt_from_eh_region (old_stmt);
+ if (new_stmt_could_throw)
+ {
+ add_stmt_to_eh_region (new_stmt, region_nr);
+ return false;
+ }
+ else
+ return true;
+ }
+
return false;
}
-