aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2005-01-21 19:05:23 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2005-01-21 19:05:23 +0000
commit089efaa4a16ff50c6c5b37e9f7add71f20c18f1b (patch)
tree29a38b973974253486c46f8b085f055eee2e1e15 /gcc/tree-cfg.c
parentd284eb28eb6f3ef8c3f27e7428b8cdc8e51d965f (diff)
downloadgcc-089efaa4a16ff50c6c5b37e9f7add71f20c18f1b.zip
gcc-089efaa4a16ff50c6c5b37e9f7add71f20c18f1b.tar.gz
gcc-089efaa4a16ff50c6c5b37e9f7add71f20c18f1b.tar.bz2
re PR tree-optimization/13000 ([unit-at-a-time] Using -O2 cannot detect missing return statement in a function)
PR tree-optimization/13000 * tree-inline.c: Include "tree-flow.h". (expand_call_inline): If warn_return_type, warn if non-void inline function falls through. * tree-cfg.c (execute_warn_function_return): Don't warn about control reaching end if TREE_NO_WARNING is set. Set TREE_NO_WARNING. * gimple-low.c (block_may_fallthru): Don't assume that SWITCH_EXPR has been lowered. * gimplify.c (shortcut_cond_expr): Don't emit a jump over the else branch if we don't need one. * c-typeck.c: Include "tree-flow.h" (c_finish_bc_stmt): Don't add a goto if the current statement list doesn't fall through to the current point. From-SVN: r94024
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 483b2dd..93dfc34 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -5677,6 +5677,7 @@ execute_warn_function_return (void)
/* If we see "return;" in some basic block, then we do reach the end
without returning a value. */
else if (warn_return_type
+ && !TREE_NO_WARNING (cfun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0
&& !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl))))
{
@@ -5697,6 +5698,7 @@ execute_warn_function_return (void)
locus = &cfun->function_end_locus;
warning ("%Hcontrol reaches end of non-void function", locus);
#endif
+ TREE_NO_WARNING (cfun->decl) = 1;
break;
}
}