]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/21847 (misscompiling of the following java code)
authorSteven Bosscher <stevenb@suse.de>
Tue, 7 Jun 2005 16:48:52 +0000 (16:48 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Tue, 7 Jun 2005 16:48:52 +0000 (16:48 +0000)
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: r100712

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

index 387adfdc628e509b2a1c97f5a351e62a34c3f57d..d21d38316826a11d715f2987cb6c9420f1246ed9 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-07  Steven Bosscher  <stevenb@suse.de>
+
+       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.
+
 2005-06-06  Jakub Jelinek  <jakub@redhat.com>
 
        * intl.h (G_): New macro.
index 30b0ddb23a808ef355af35dede224c0c98cd5428..a236206ff3927b4d7a73853fd71c8e78a63e957e 100644 (file)
@@ -283,6 +283,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