OSDN Git Service

PR tree-optimization/21847
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Jun 2005 16:54:16 +0000 (16:54 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Jun 2005 16:54:16 +0000 (16:54 +0000)
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): With
-fnon-call-exceptions, also mark statements inherently
necessary if they may throw.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100714 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6796d23..12f036b 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-07  Adrian Straetling  <straetling@de.ibm.com>
 
        * config/s390/s390.md: ("UNSPECV_MB", "UNSPECV_CAS"): New constants.
 2005-06-07  Adrian Straetling  <straetling@de.ibm.com>
 
        * config/s390/s390.md: ("UNSPECV_MB", "UNSPECV_CAS"): New constants.
index 65c85eb..f6e62dc 100644 (file)
@@ -279,6 +279,15 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
   tree op, def;
   ssa_op_iter iter;
 
   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
   /* 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