diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-07 12:44:54 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-07 12:44:54 +0000 |
commit | dc5b5d21b88a2249c02d54dbaf91e480a8d1fa5d (patch) | |
tree | 9a20274567104fda6593fcc35ed4b64bb5d20406 /gcc/gimplify.c | |
parent | 30ac4925289c200c7e959ce741c95e1672c1923c (diff) | |
download | gcc-dc5b5d21b88a2249c02d54dbaf91e480a8d1fa5d.tar.gz |
* gimplify.c (should_warn_for_implicit_fallthrough): Check for
FALLTHROUGH_LABEL_P here...
(warn_implicit_fallthrough_r): ...not here.
* c-c++-common/Wimplicit-fallthrough-22.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index a60d9471c68..2266333442a 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1819,6 +1819,10 @@ should_warn_for_implicit_fallthrough (gimple_stmt_iterator *gsi_p, tree label) { gimple_stmt_iterator gsi = *gsi_p; + /* Don't warn if the label is marked with a "falls through" comment. */ + if (FALLTHROUGH_LABEL_P (label)) + return false; + /* Don't warn for a non-case label followed by a statement: case 0: foo (); @@ -1905,7 +1909,6 @@ warn_implicit_fallthrough_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, if (gimple_code (next) == GIMPLE_LABEL && gimple_has_location (next) && (label = gimple_label_label (as_a <glabel *> (next))) - && !FALLTHROUGH_LABEL_P (label) && prev != NULL) { struct label_entry *l; |