diff options
author | Marek Polacek <polacek@redhat.com> | 2016-09-26 09:42:50 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-09-26 09:42:50 +0000 |
commit | 81fea426da8c4687bb32e6894dc26f00ae211822 (patch) | |
tree | 8b84b3de175727d09b7dcf1b5703e0d46b64f9e7 /gcc/fortran | |
parent | 392fa55c799358e198ca85fbea548e60359133c5 (diff) | |
download | gcc-81fea426da8c4687bb32e6894dc26f00ae211822.zip gcc-81fea426da8c4687bb32e6894dc26f00ae211822.tar.gz gcc-81fea426da8c4687bb32e6894dc26f00ae211822.tar.bz2 |
Implement -Wimplicit-fallthrough.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r240485
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/fortran/arith.c | 2 | ||||
-rw-r--r-- | gcc/fortran/frontend-passes.c | 3 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 2 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 1 |
8 files changed, 20 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5675e03..dee19de 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2016-09-26 Marek Polacek <polacek@redhat.com> + + PR c/7652 + * arith.c (eval_intrinsic): Add gcc_fallthrough. + * frontend-passes.c (optimize_op): Likewise. + (gfc_expr_walker): Likewise. + * parse.c (next_fixed): Likewise. + * primary.c (match_variable): Likewise. + * trans-array.c: Likewise. + * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. + * trans-io.c (transfer_expr): Likewise. + 2016-09-25 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/77429 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 47a5504..8af7540 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -1521,7 +1521,7 @@ eval_intrinsic (gfc_intrinsic_op op, break; } - /* Fall through */ + gcc_fallthrough (); /* Numeric binary */ case INTRINSIC_PLUS: case INTRINSIC_MINUS: diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 3a2c16e..e049fb9 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -1481,7 +1481,7 @@ optimize_op (gfc_expr *e) case INTRINSIC_LT: changed = optimize_comparison (e, op); - /* Fall through */ + gcc_fallthrough (); /* Look at array constructors. */ case INTRINSIC_PLUS: case INTRINSIC_MINUS: @@ -3349,6 +3349,7 @@ gfc_expr_walker (gfc_expr **e, walk_expr_fn_t exprfn, void *data) /* Fall through to the variable case in order to walk the reference. */ + gcc_fallthrough (); case EXPR_SUBSTRING: case EXPR_VARIABLE: diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index a89e834..73cb0db 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1261,7 +1261,7 @@ next_fixed (void) return decode_oacc_directive (); } } - /* FALLTHROUGH */ + gcc_fallthrough (); /* Comments have already been skipped by the time we get here so don't bother checking for them. */ diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index c5e9778..85589ee 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -3572,6 +3572,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag) break; /* Fall through to error */ + gcc_fallthrough (); default: gfc_error ("%qs at %C is not a variable", sym->name); diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index bb33a23..0b97760 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -4032,6 +4032,7 @@ done: continue; } /* Otherwise fall through GFC_SS_FUNCTION. */ + gcc_fallthrough (); } case GFC_ISYM_LCOBOUND: case GFC_ISYM_UCOBOUND: diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9fcd6a1..a821788 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2208,6 +2208,7 @@ flatten_array_ctors_without_strlen (gfc_expr* e) } /* Otherwise, fall through to handle constructor elements. */ + gcc_fallthrough (); case EXPR_STRUCTURE: for (c = gfc_constructor_first (e->value.constructor); c; c = gfc_constructor_next (c)) diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index c0559f3..3cdbf1f 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -2384,6 +2384,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, } /* If a CLASS object gets through to here, fall through and ICE. */ } + gcc_fallthrough (); default: gfc_internal_error ("Bad IO basetype (%d)", ts->type); } |