diff options
author | Ian Lance Taylor <ian@airs.com> | 2005-01-28 17:32:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2005-01-28 17:32:57 +0000 |
commit | 09f8cf2de9eafc6247038b4e9517ccd09ba53ea6 (patch) | |
tree | 6d6a388ad6a6b5ea928aaa1b993c788e29f3c7e6 /gcc/gimple-low.c | |
parent | 91e390fe3dd2e1ec29b6742c69a83d687f135657 (diff) | |
download | gcc-09f8cf2de9eafc6247038b4e9517ccd09ba53ea6.zip gcc-09f8cf2de9eafc6247038b4e9517ccd09ba53ea6.tar.gz gcc-09f8cf2de9eafc6247038b4e9517ccd09ba53ea6.tar.bz2 |
re PR middle-end/16558 (bogus missing-return warning)
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.
From-SVN: r94381
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 5165a9a..6e60aeb 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -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) |