------- Additional Comments From steven at gcc dot gnu dot org  2005-06-05 
23:42 -------
I believe something like this is necessary. 
 
Index: tree-ssa-dce.c 
=================================================================== 
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v 
retrieving revision 2.44 
diff -u -3 -p -r2.44 tree-ssa-dce.c 
--- tree-ssa-dce.c      1 Jun 2005 02:50:59 -0000       2.44 
+++ tree-ssa-dce.c      5 Jun 2005 23:41:58 -0000 
@@ -279,6 +279,15 @@ mark_stmt_if_obviously_necessary (tree s 
   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, false); 
+      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 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21847

Reply via email to