aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-21 15:51:19 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-21 15:51:19 +0100
commitbccc50d44c8b79ecb6b0237912e96369e5625d17 (patch)
tree2b7fe3b05edf700cf89f2391169f78c73ef31628 /gcc/tree-eh.c
parent2091795abd48effcbfe9407b7954021473175b0a (diff)
downloadgcc-bccc50d44c8b79ecb6b0237912e96369e5625d17.zip
gcc-bccc50d44c8b79ecb6b0237912e96369e5625d17.tar.gz
gcc-bccc50d44c8b79ecb6b0237912e96369e5625d17.tar.bz2
re PR middle-end/51644 (va_list vs. warning: ‘noreturn’ function does return is not fixable)
PR middle-end/51644 PR middle-end/51647 * tree-eh.c (decide_copy_try_finally): At -O0, return true even when ndests is not 1, if there are only gimple_clobber_p (or debug) stmts in the finally sequence. * tree-inline.c (estimate_num_insns): Return 0 for gimple_clobber_p stmts. * gcc.dg/pr51644.c: New test. * g++.dg/warn/Wreturn-4.C: New test. From-SVN: r182589
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 0631ee1..cad37e6 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -1538,7 +1538,20 @@ decide_copy_try_finally (int ndests, bool may_throw, gimple_seq finally)
}
if (!optimize)
- return ndests == 1;
+ {
+ gimple_stmt_iterator gsi;
+
+ if (ndests == 1)
+ return true;
+
+ for (gsi = gsi_start (finally); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!is_gimple_debug (stmt) && !gimple_clobber_p (stmt))
+ return false;
+ }
+ return true;
+ }
/* Finally estimate N times, plus N gotos. */
f_estimate = count_insns_seq (finally, &eni_size_weights);