summaryrefslogtreecommitdiff
path: root/gcc/gimple-low.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-21 19:05:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-21 19:05:23 +0000
commit7f0f308dcade9eae784cde48b97fcb750195d95e (patch)
tree29a38b973974253486c46f8b085f055eee2e1e15 /gcc/gimple-low.c
parenta47b9d7927305dd956767900ce235bffc4e9310d (diff)
downloadgcc-7f0f308dcade9eae784cde48b97fcb750195d95e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94024 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r--gcc/gimple-low.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index eb495288eee..17ba0393c25 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -278,11 +278,17 @@ block_may_fallthru (tree block)
case GOTO_EXPR:
case RETURN_EXPR:
case RESX_EXPR:
- case SWITCH_EXPR:
/* Easy cases. If the last statement of the block implies
control transfer, then we can't fall through. */
return false;
+ case SWITCH_EXPR:
+ /* If SWITCH_LABELS is set, this is lowered, and represents a
+ branch to a selected label and hence can not fall through.
+ Otherwise SWITCH_BODY is set, and the switch can fall
+ through. */
+ return SWITCH_LABELS (stmt) != NULL_TREE;
+
case COND_EXPR:
if (block_may_fallthru (COND_EXPR_THEN (stmt)))
return true;