These are the cases where I wasn't sure if the falls through were intentional or not.
This patch has been tested on powerpc64le-unknown-linux-gnu, aarch64-linux-gnu, and x86_64-redhat-linux. 2016-07-27 Marek Polacek <pola...@redhat.com> PR c/7652 gcc/ * config/i386/i386.c (ix86_expand_branch): Add gcc_fallthrough.. * cselib.c (cselib_expand_value_rtx_1): Likewise. * gensupport.c (get_alternatives_number): Likewise. (subst_dup): Likewise. * gimplify.c (goa_stabilize_expr): Likewise. * hsa-gen.c (gen_hsa_insn_for_internal_fn_call): Likewise. * reg-stack.c (get_true_reg): Likewise. * tree-complex.c (expand_complex_division): Likewise. * tree-data-ref.c (get_references_in_stmt): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * var-tracking.c (adjust_mems): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add gcc_fallthrough. * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. * parser.c (cp_parser_skip_to_end_of_statement): Likewise. (cp_parser_cache_defarg): Likewise. gcc/c-family/ * c-ada-spec.c (dump_generic_ada_node): Add gcc_fallthrough. libcpp/ * pch.c (write_macdef): Add CPP_FALLTHRU. * lex.c (_cpp_lex_direct): Likewise. diff --git gcc/gcc/c-family/c-ada-spec.c gcc/gcc/c-family/c-ada-spec.c index e33fdff..659ffa0 100644 --- gcc/gcc/c-family/c-ada-spec.c +++ gcc/gcc/c-family/c-ada-spec.c @@ -1862,6 +1862,8 @@ 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); + /* XXX Really fallthru? */ + gcc_fallthrough (); case TREE_VEC: pp_string (buffer, "--- unexpected node: TREE_VEC"); --- gcc/gcc/config/i386/i386.c +++ gcc/gcc/config/i386/i386.c @@ -22484,6 +22495,8 @@ ix86_expand_branch (enum rtx_code code, rtx op0, rtx op1, rtx label) op0 = force_reg (mode, gen_rtx_XOR (mode, op0, op1)); op1 = const0_rtx; } + /* XXX Really fallthru? */ + gcc_fallthrough (); case TImode: /* Expand DImode branch into multiple compare+branch. */ { --- gcc/gcc/cp/call.c +++ gcc/gcc/cp/call.c @@ -2542,6 +2544,8 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, type2 = ptrdiff_type_node; break; } + /* XXX Really fallthru? */ + gcc_fallthrough (); case MULT_EXPR: case TRUNC_DIV_EXPR: if (ARITHMETIC_TYPE_P (type1) && ARITHMETIC_TYPE_P (type2)) --- gcc/gcc/cp/cxx-pretty-print.c +++ gcc/gcc/cp/cxx-pretty-print.c @@ -142,6 +142,8 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case OVERLOAD: t = OVL_CURRENT (t); + /* XXX Really fallthru? */ + gcc_fallthrough (); case VAR_DECL: case PARM_DECL: case CONST_DECL: --- gcc/gcc/cp/parser.c +++ gcc/gcc/cp/parser.c @@ -3488,6 +3488,8 @@ cp_parser_skip_to_end_of_statement (cp_parser* parser) cp_lexer_consume_token (parser->lexer); return; } + /* XXX Really fallthru? */ + gcc_fallthrough (); case CPP_OPEN_BRACE: ++nesting_depth; @@ -27640,6 +27646,8 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi) parser->in_template_argument_list_p = saved_italp; break; } + /* XXX Really fallthru? */ + gcc_fallthrough (); case CPP_CLOSE_PAREN: case CPP_ELLIPSIS: /* If we run into a non-nested `;', `}', or `]', --- gcc/gcc/cselib.c +++ gcc/gcc/cselib.c @@ -1619,6 +1619,8 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd, return orig; } } + /* XXX Really fallthru? */ + gcc_fallthrough (); CASE_CONST_ANY: case SYMBOL_REF: diff --git gcc/gcc/gensupport.c gcc/gcc/gensupport.c index 0eb4591..795f88c 100644 --- gcc/gcc/gensupport.c +++ gcc/gcc/gensupport.c @@ -1038,6 +1038,8 @@ get_alternatives_number (rtx pattern, int *n_alt, file_location loc) case 'V': if (XVEC (pattern, i) == NULL) break; + /* XXX Really fallthru? */ + gcc_fallthrough (); case 'E': for (j = XVECLEN (pattern, i) - 1; j >= 0; --j) @@ -2156,6 +2158,8 @@ subst_dup (rtx pattern, int n_alt, int n_subst_alt) case 'V': if (XVEC (pattern, i) == NULL) break; + /* XXX Really fallthru? */ + gcc_fallthrough (); case 'E': if (code != MATCH_DUP && code != MATCH_OP_DUP) for (j = XVECLEN (pattern, i) - 1; j >= 0; --j) --- gcc/gcc/gimplify.c +++ gcc/gcc/gimplify.c @@ -10320,6 +10324,8 @@ goa_stabilize_expr (tree *expr_p, gimple_seq *pre_p, tree lhs_addr, case tcc_comparison: saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p, lhs_addr, lhs_var); + /* XXX Really fallthru? */ + gcc_fallthrough (); case tcc_unary: saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p, lhs_addr, lhs_var); @@ -10334,6 +10340,8 @@ goa_stabilize_expr (tree *expr_p, gimple_seq *pre_p, tree lhs_addr, case TRUTH_XOR_EXPR: saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p, lhs_addr, lhs_var); + /* XXX Really fallthru? */ + gcc_fallthrough (); case TRUTH_NOT_EXPR: saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p, lhs_addr, lhs_var); --- gcc/gcc/hsa-gen.c +++ gcc/gcc/hsa-gen.c @@ -5039,6 +5039,8 @@ 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); + /* XXX Really fallthru? */ + gcc_fallthrough (); default: HSA_SORRY_ATV (gimple_location (stmt), diff --git gcc/gcc/reg-stack.c gcc/gcc/reg-stack.c index c931349..a4a3ac2 100644 --- gcc/gcc/reg-stack.c +++ gcc/gcc/reg-stack.c @@ -423,6 +423,8 @@ get_true_reg (rtx *pat) GET_MODE (subreg)); return pat; } + /* XXX Really fallthru? */ + gcc_fallthrough (); } case FLOAT: case FIX: diff --git gcc/gcc/tree-complex.c gcc/gcc/tree-complex.c index d7baf22..9cb8986 100644 --- gcc/gcc/tree-complex.c +++ gcc/gcc/tree-complex.c @@ -1336,6 +1336,8 @@ expand_complex_division (gimple_stmt_iterator *gsi, tree inner_type, rr = gimplify_build2 (gsi, code, inner_type, ai, bi); ri = gimplify_build2 (gsi, code, inner_type, ar, bi); ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ri); + /* XXX Really fallthru? */ + gcc_fallthrough (); case PAIR (ONLY_REAL, VARYING): case PAIR (ONLY_IMAG, VARYING): --- gcc/gcc/tree-data-ref.c +++ gcc/gcc/tree-data-ref.c @@ -3889,7 +3890,9 @@ get_references_in_stmt (gimple *stmt, vec<data_ref_loc, va_heap> *references) case IFN_MASK_LOAD: if (gimple_call_lhs (stmt) == NULL_TREE) break; + /* XXX Really fallthru? */ ref.is_read = true; + gcc_fallthrough (); case IFN_MASK_STORE: ptr = build_int_cst (TREE_TYPE (gimple_call_arg (stmt, 1)), 0); align = tree_to_shwi (gimple_call_arg (stmt, 1)); --- gcc/gcc/tree-pretty-print.c +++ gcc/gcc/tree-pretty-print.c @@ -2946,6 +2947,8 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags, dump_omp_loop: dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags); + /* XXX Really fallthru? */ + gcc_fallthrough (); dump_omp_loop_cilk_for: if (!(flags & TDF_SLIM)) --- gcc/gcc/var-tracking.c +++ gcc/gcc/var-tracking.c @@ -1056,6 +1056,8 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) ? GET_MODE_SIZE (amd->mem_mode) : -GET_MODE_SIZE (amd->mem_mode), GET_MODE (loc))); + /* XXX Really fallthru? */ + gcc_fallthrough (); case POST_INC: case POST_DEC: if (addr == loc) @@ -1076,6 +1078,8 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) return addr; case PRE_MODIFY: addr = XEXP (loc, 1); + /* XXX Really fallthru? */ + gcc_fallthrough (); case POST_MODIFY: if (addr == loc) addr = XEXP (loc, 0); --- gcc/libcpp/pch.c +++ gcc/libcpp/pch.c @@ -55,6 +55,8 @@ write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p) case NT_VOID: if (! (hn->flags & NODE_POISONED)) return 1; + /* XXX Really fallthru? */ + CPP_FALLTHRU; case NT_MACRO: if ((hn->flags & NODE_BUILTIN) --- gcc/libcpp/lex.c +++ gcc/libcpp/lex.c @@ -2815,6 +2817,8 @@ _cpp_lex_direct (cpp_reader *pfile) } buffer->cur++; } + /* XXX Really fallthru? */ + CPP_FALLTHRU; default: create_literal (pfile, result, buffer->cur - 1, 1, CPP_OTHER); Marek