aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-10-07 12:44:54 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-10-07 12:44:54 +0000
commita9172bf307dd49fa001387f4b514ea49d38f2092 (patch)
tree9a20274567104fda6593fcc35ed4b64bb5d20406 /gcc/gimplify.c
parent8a14afd0657b21e1de31fd1b2146056b09dbab5b (diff)
downloadgcc-a9172bf307dd49fa001387f4b514ea49d38f2092.zip
gcc-a9172bf307dd49fa001387f4b514ea49d38f2092.tar.gz
gcc-a9172bf307dd49fa001387f4b514ea49d38f2092.tar.bz2
gimplify.c (should_warn_for_implicit_fallthrough): Check for FALLTHROUGH_LABEL_P here...
* 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. From-SVN: r240864
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index a60d947..2266333 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;