aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 2ed4c31..7d01eb6 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -3144,10 +3144,6 @@ rest_of_compilation (tree decl)
delete_unreachable_blocks ();
- /* We have to issue these warnings now already, because CFG cleanups
- further down may destroy the required information. */
- check_function_return_warnings ();
-
/* Turn NOTE_INSN_PREDICTIONs into branch predictions. */
if (flag_guess_branch_prob)
{
@@ -3159,6 +3155,14 @@ rest_of_compilation (tree decl)
if (flag_optimize_sibling_calls)
rest_of_handle_sibling_calls (insns);
+ /* We have to issue these warnings now already, because CFG cleanups
+ further down may destroy the required information. However, this
+ must be done after the sibcall optimization pass because the barrier
+ emitted for noreturn calls that are candidate for the optimization
+ is folded into the CALL_PLACEHOLDER until after this pass, so the
+ CFG is inaccurate. */
+ check_function_return_warnings ();
+
timevar_pop (TV_JUMP);
insn_locators_initialize ();