From f0bc3323eb5132b2d7e4c87ec2f213a18d72712d Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 9 Aug 2016 16:39:28 +0000 Subject: [PATCH] re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/c-family/ * c-ada-spec.c (dump_generic_ada_node): Add return. gcc/ * cselib.c (cselib_expand_value_rtx_1): Add return. * gengtype.c (dbgprint_count_type_at): Likewise. * hsa-gen.c (gen_hsa_insn_for_internal_fn_call): Likewise. * reg-stack.c (get_true_reg): Restructure to avoid fallthrough warning. From-SVN: r239297 --- gcc/ChangeLog | 8 ++++++++ gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-ada-spec.c | 1 + gcc/cselib.c | 1 + gcc/gengtype.c | 1 + gcc/hsa-gen.c | 1 + gcc/reg-stack.c | 8 +++++--- 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 854dea5249a..cee39a1c0c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-08-09 Marek Polacek + + PR c/7652 + * cselib.c (cselib_expand_value_rtx_1): Add return. + * gengtype.c (dbgprint_count_type_at): Likewise. + * hsa-gen.c (gen_hsa_insn_for_internal_fn_call): Likewise. + * reg-stack.c (get_true_reg): Restructure to avoid fallthrough warning. + 2016-08-09 Martin Jambor PR ipa/71981 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4b24dd62a7e..a1dbc735c50 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2016-08-09 Marek Polacek + + PR c/7652 + * c-ada-spec.c (dump_generic_ada_node): Add return. + 2016-08-09 Jason Merrill * c-cppbuiltin.c (c_cpp_builtins): Update __cpp_constexpr for diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index e33fdffef0e..17b86103fec 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -1862,6 +1862,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc, case TREE_BINFO: dump_generic_ada_node (buffer, BINFO_TYPE (node), type, spc, limited_access, name_only); + return 0; case TREE_VEC: pp_string (buffer, "--- unexpected node: TREE_VEC"); diff --git a/gcc/cselib.c b/gcc/cselib.c index 0c5183cf730..1277842783b 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1618,6 +1618,7 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd, else return orig; } + return orig; } CASE_CONST_ANY: diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 5479b8f09ab..05183554b2a 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -175,6 +175,7 @@ dbgprint_count_type_at (const char *fil, int lin, const char *msg, type_p t) { case TYPE_UNDEFINED: nb_undefined++; + break; case TYPE_SCALAR: nb_scalar++; break; diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c index 6cf15384363..fa4ef126ac5 100644 --- a/gcc/hsa-gen.c +++ b/gcc/hsa-gen.c @@ -5039,6 +5039,7 @@ gen_hsa_insn_for_internal_fn_call (gcall *stmt, hsa_bb *hbb) case IFN_FMIN: case IFN_FMAX: gen_hsa_insns_for_call_of_internal_fn (stmt, hbb); + break; default: HSA_SORRY_ATV (gimple_location (stmt), diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index c931349f0f4..907f28de581 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -423,23 +423,25 @@ get_true_reg (rtx *pat) GET_MODE (subreg)); return pat; } + pat = &XEXP (*pat, 0); + break; } case FLOAT: case FIX: case FLOAT_EXTEND: - pat = & XEXP (*pat, 0); + pat = &XEXP (*pat, 0); break; case UNSPEC: if (XINT (*pat, 1) == UNSPEC_TRUNC_NOOP || XINT (*pat, 1) == UNSPEC_FILD_ATOMIC) - pat = & XVECEXP (*pat, 0, 0); + pat = &XVECEXP (*pat, 0, 0); return pat; case FLOAT_TRUNCATE: if (!flag_unsafe_math_optimizations) return pat; - pat = & XEXP (*pat, 0); + pat = &XEXP (*pat, 0); break; default: -- 2.30.2