diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-12-21 15:51:19 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-12-21 15:51:19 +0100 |
commit | bccc50d44c8b79ecb6b0237912e96369e5625d17 (patch) | |
tree | 2b7fe3b05edf700cf89f2391169f78c73ef31628 /gcc/tree-eh.c | |
parent | 2091795abd48effcbfe9407b7954021473175b0a (diff) | |
download | gcc-bccc50d44c8b79ecb6b0237912e96369e5625d17.tar.gz |
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.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 0631ee1cf8d..cad37e67242 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); |