aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-06-07 16:54:16 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-06-07 16:54:16 +0000
commit75b80166a26a5844e82097fe3414cfea822eebd9 (patch)
treede57d6e4b854feb8d7462b3305cd895ca216196b /gcc/tree-ssa-dce.c
parent225962a09b477edd843f345218f75aaa71fea52f (diff)
downloadgcc-75b80166a26a5844e82097fe3414cfea822eebd9.zip
gcc-75b80166a26a5844e82097fe3414cfea822eebd9.tar.gz
gcc-75b80166a26a5844e82097fe3414cfea822eebd9.tar.bz2
re PR tree-optimization/21847 (misscompiling of the following java code)
PR tree-optimization/21847 * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): With -fnon-call-exceptions, also mark statements inherently necessary if they may throw. From-SVN: r100714
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 65c85eb..f6e62dc 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -279,6 +279,15 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
tree op, def;
ssa_op_iter iter;
+ /* With non-call exceptions, we have to assume that all statements could
+ throw. If a statement may throw, it is inherently necessary. */
+ if (flag_non_call_exceptions
+ && tree_could_throw_p (stmt))
+ {
+ mark_stmt_necessary (stmt, true);
+ return;
+ }
+
/* Statements that are implicitly live. Most function calls, asm and return
statements are required. Labels and BIND_EXPR nodes are kept because
they are control flow, and we have no way of knowing whether they can be