OSDN Git Service

PR middle-end/16558
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Jan 2005 17:32:57 +0000 (17:32 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Jan 2005 17:32:57 +0000 (17:32 +0000)
PR middle-end/19583
* gimple-low.c (block_may_fallthru): TRY_FINALLY_EXPR only falls
through if both operands fall through.

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

gcc/ChangeLog
gcc/gimple-low.c

index af2c494..97410c0 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-28  Ian Lance Taylor  <ian@airs.com>
+
+       PR middle-end/16558
+       PR middle-end/19583
+       * gimple-low.c (block_may_fallthru): TRY_FINALLY_EXPR only falls
+       through if both operands fall through.
+
 2005-01-28  Kazu Hirata  <kazu@cs.umass.edu>
 
        * cse.c (fold_rtx) <PC>: Don't optimize.
        * tree-ssa-dom.c (tree_ssa_dominator_optimize): Only iterate at -O2
        and better.
 
-2005-01-27  Ian Lance Taylor  <ian@c2micro.com>
+2005-01-27  Ian Lance Taylor  <ian@airs.com>
 
        PR middle-end/19583
        * gimple-low.c (try_catch_may_fallthru): New static function.
index 5165a9a..6e60aeb 100644 (file)
@@ -348,7 +348,15 @@ block_may_fallthru (tree block)
       return try_catch_may_fallthru (stmt);
 
     case TRY_FINALLY_EXPR:
-      return block_may_fallthru (TREE_OPERAND (stmt, 1));
+      /* The finally clause is always executed after the try clause,
+        so if it does not fall through, then the try-finally will not
+        fall through.  Otherwise, if the try clause does not fall
+        through, then when the finally clause falls through it will
+        resume execution wherever the try clause was going.  So the
+        whole try-finally will only fall through if both the try
+        clause and the finally clause fall through.  */
+      return (block_may_fallthru (TREE_OPERAND (stmt, 0))
+             && block_may_fallthru (TREE_OPERAND (stmt, 1)));
 
     case MODIFY_EXPR:
       if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)