...and the boring part. It found a few bugs, e.g. in jcf-dump.c and rs6000.c - I fixed those.
I think generally it's better to use the attribute rather than a falls through comment, because the latter can't be followed by other comment or a macro to work. This patch has been tested on powerpc64le-unknown-linux-gnu, aarch64-linux-gnu, and x86_64-redhat-linux. 2016-07-22 Marek Polacek <pola...@redhat.com> PR c/7652 gcc/ * Makefile.in (insn-attrtab.o-warn, insn-dfatab.o-warn, insn-latencytab.o-warn, insn-output.o-warn, insn-emit.o-warn): Add -Wno-switch-fallthrough. * alias.c (find_base_value): Adjust falls through comment. * builtins.c (expand_builtin_int_roundingfn_2): Add gcc_fallthrough. (expand_builtin): Likewise. * cfgexpand.c (expand_debug_expr): Adjust falls through comment. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add gcc_fallthrough. (make_compound_operation): Adjust falls through comment. (canon_reg_for_combine): Add gcc_fallthrough. (force_to_mode): Adjust falls through comment. Add gcc_fallthrough. (simplify_shift_const_1): Adjust falls through comment. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add gcc_fallthrough. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (ix86_gimplify_va_arg): Add gcc_fallthrough. (ix86_legitimate_constant_p): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust falls through comment. (ix86_expand_multi_arg_builtin): Add gcc_fallthrough. (ix86_expand_args_builtin): Add break. (ix86_expand_round_builtin): Likewise. (ix86_expand_builtin): Add gcc_fallthrough. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_builtin_vectorized_libmass): Likewise. (altivec_expand_ld_builtin): Add break. (altivec_expand_st_builtin): Likewise. (rs6000_emit_vector_compare_inner): Add gcc_fallthrough. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. (rs6000_handle_altivec_attribute): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust falls through comment. * convert.c (convert_to_real_1): Add gcc_fallthrough. (convert_to_integer_1): Likewise. * cselib.c (cselib_expand_value_rtx_1): Add gcc_fallthrough. * dbxout.c (dbxout_symbol): Adjust falls through comment. * gcc/df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add gcc_fallthrough. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust falls through comment. (resolve_args_picking_1): Likewise. (loc_list_from_tree_1): Likewise. (gen_formal_parameter_die): Likewise. * expmed.c (expand_divmod): Add gcc_fallthrough. (make_tree): Adjust falls through comment. * expr.c (expand_expr_real_2): Add gcc_fallthrough. (expand_expr_real_1): Likewise. Adjust falls through comment. * final.c (output_alternate_entry_point): Add gcc_fallthrough. * fold-const.c (const_binop): Adjust falls through comment. (fold_truth_not_expr): Likewise. (make_range_step): Add gcc_fallthrough. (fold_cond_expr_with_comparison): Likewise. (fold_binary_loc): Likewise. (contains_label_1): Adjust falls through comment. (multiple_of_p): Likewise. * gcc.c (driver_handle_option): Add gcc_fallthrough. * gcov-tool.c (process_args): Likewise. * genattrtab.c (check_attr_test): Likewise. (make_canonical): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * gengtype.c (dbgprint_count_type_at): Add break. * genpreds.c (validate_exp): Adjust falls through comment. Add gcc_fallthrough. (needs_variable): Adjust falls through comment. * gensupport.c (get_alternatives_number): Add gcc_fallthrough. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * gimplify.c (gimplify_addr_expr): Adjust falls through comment. (omp_default_clause): Add gcc_fallthrough. (gimplify_scan_omp_clauses): Likewise. (goa_stabilize_expr): Likewise. * godump.c (go_format_type): Add gcc_fallthrough. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust falls through comment. * hsa-gen.c (get_address_from_value): Likewise. (gen_hsa_insn_for_internal_fn_call): Add gcc_fallthrough. * ipa-icf.c (sem_function::hash_stmt): Adjust falls through comment. * ira.c (ira_setup_alts): Add gcc_fallthrough. * lra-eliminations.c (lra_eliminate_regs_1): Adjust falls through comment. * lto-streamer-out.c (lto_output_tree_ref): Add gcc_fallthrough. * omp-low.c (scan_sharing_clauses): Add gcc_fallthrough. (lower_rec_input_clauses): Likewise. * opts.c (common_handle_option): Likewise. * print-rtl.c (print_rtx): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reg-stack.c (get_true_reg): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust falls through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (elimination_effects): Add gcc_fallthrough. (reload_reg_reaches_end_p): Adjust falls through comment. * gcc/resource.c (mark_referenced_resources): Add gcc_fallthrough. (mark_set_resources): Likewise. * rtlanal.c (reg_overlap_mentioned_p): Likewise. (commutative_operand_precedence): Likewise. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. (simplify_rtx): Adjust falls through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Add gcc_fallthrough. (print_to_stderr): Add gcc_fallthrough. * tree-cfg.c (gimple_verify_flow_info): Adjust falls through comment. * tree-chrec.c (chrec_fold_plus_1): Add gcc_fallthrough. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-complex.c (expand_complex_division): Likewise. * tree-data-ref.c (siv_subscript_p): Add gcc_fallthrough. (get_references_in_stmt): Likewise. * tree-pretty-print.c (dump_omp_clause): Likewise. (dump_generic_node): Likewise. * tree-ssa-loop-ivopts.c (find_deriving_biv_for_expr): Likewise. * tree-vect-patterns.c (adjust_bool_pattern): Likewise. * tree.c (find_placeholder_in_expr): Adjust falls through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add gcc_fallthrough. * tree-eh.c (lower_eh_constructs_2): Likewise. * var-tracking.c (adjust_mems): Likewise. (set_dv_changed): Adjust falls through comment. * varasm.c (default_function_section): Add gcc_fallthrough. (const_rtx_hash_1): Likewise. (output_addressed_constants): Adjust falls through comment. * include/libiberty.h (D_FALLTHRU): Define. gcc/c-family/ * c-ada-spec.c (dump_generic_ada_node): Add gcc_fallthrough. * c-common.c (warn_if_unused_value): Likewise. (resolve_overloaded_builtin): Add gcc_fallthrough. (scalar_to_vector): Adjust falls through comment. * c-lex.c (lex_string): Add gcc_fallthrough. * c-opts.c (c_common_handle_option): Adjust falls through comment. * c-pragma.c (handle_pragma_pack): Add gcc_fallthrough. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust falls through comment. * cilk.c (extract_free_variables): Add gcc_fallthrough. gcc/c/ * c-decl.c (pop_scope): Add gcc_fallthrough. * c-parser.c (c_parser_external_declaration): Add gcc_fallthrough. (c_parser_statement_after_labels): Add gcc_fallthrough. (c_parser_postfix_expression): Add gcc_fallthrough. * c-typeck.c (composite_type): Adjust falls through comment. (build_unary_op): Likewise. (c_mark_addressable): Add gcc_fallthrough. (c_finish_omp_clauses): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add gcc_fallthrough. (build_integral_nontype_arg_conv): Adjust falls through comment. (build_new_op_1): Add gcc_fallthrough. (convert_like_real): Adjust falls through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Adjust falls through comment. (potential_constant_expression_1): Likewise. Add gcc_fallthrough. * cp-gimplify.c (cp_gimplify_expr): Adjust falls through comment. (cp_fold): Add gcc_fallthrough. * cvt.c (build_expr_type_conversion): Adjust falls through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add gcc_fallthrough. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust falls through comment. (cxx_pretty_printer::primary_expression): Add gcc_fallthrough. (pp_cxx_pm_expression): Adjust falls through comment. (cxx_pretty_printer::expression): Add gcc_fallthrough. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust falls through comment. (pp_cxx_ptr_operator): Likewise. Add gcc_fallthrough. * error.c (dump_type): Likewise. (dump_decl): Likewise. (dump_expr): Add gcc_fallthrough. * mangle.c (write_type): Adjust falls through comment. * method.c (synthesized_method_walk): Add gcc_fallthrough. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust falls through comment. (cp_parser_skip_to_end_of_statement): Add gcc_fallthrough. (cp_parser_primary_expression): Likewise. (cp_parser_statement): Handle fallthrough attribute. (cp_parser_label_for_labeled_statement): Set FALLTHROUGH_LABEL_P on labels. (cp_parser_storage_class_specifier_opt): Add gcc_fallthrough. (cp_parser_operator): Likewise. (cp_parser_std_attribute): Handle fallthrough attribute. (cp_parser_check_std_attribute): Detect duplicated fallthrough attribute. (cp_parser_skip_to_end_of_template_parameter_list): Add gcc_fallthrough. (cp_parser_cache_defarg): Likewise. (cp_parser_omp_for_cond): Likewise. * pt.c (find_parameter_packs_r): Add gcc_fallthrough. (tsubst_aggr_type): Adjust falls through comment. (unify): Add gcc_fallthrough. * semantics.c (finish_omp_clauses): Likewise. (finish_decltype_type): Likewise. * tree.c (lvalue_kind): Likewise. * typeck.c (structural_comptypes): Likewise. (cp_build_binary_op): Likewise. (cp_build_modify_expr): Likewise. gcc/fortran/ * arith.c (eval_intrinsic): Add gcc_fallthrough. * array.c (gfc_ref_dimen_size): Likewise. * decl.c (match_attr_spec): Likewise. * dependency.c (dep_ref): Likewise. * dump-parse-tree.c (show_code_node): Likewise. * frontend-passes.c (optimize_op): Likewise. (gfc_expr_walker): Likewise. * parse.c (next_fixed): Likewise. * primary.c (match_arg_list_function): Likewise. (gfc_match_rvalue): Likewise. (match_variable): Likewise. * resolve.c (resolve_operator): Adjust falls through comment. (fixup_charlen): Add gcc_fallthrough. (resolve_allocate_expr): Adjust falls through comment. * trans-array.c (gfc_conv_ss_startstride): Add gcc_fallthrough. * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. * trans-intrinsic.c (conv_intrinsic_cobound): Likewise. (gfc_conv_intrinsic_len): Adjust falls through comment. * trans-stmt.c (gfc_trans_where_2): Add gcc_fallthrough. gcc/go/ * go-system.h (go_fallthrough): Define. * gofrontend/escape.cc (Escape_analysis_assign::assign): Add go_fallthrough. * gofrontend/expressions.cc (Binary_expression::do_get_backend): Likewise. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust falls through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. Add gcc_fallthrough. * jcf-dump.c (print_constant): Add break. gcc/objc/ * objc-encoding.c (encode_type): Add gcc_fallthrough. libcpp/ * lex.c (search_line_fast): Add CPP_FALLTHRU. (lex_raw_string): Likewise. (_cpp_lex_direct): Add CPP_FALLTHRU. (cpp_token_val_index): Adjust falls through comment. * macro.c (parse_params): Add CPP_FALLTHRU. * pch.c (write_macdef): Add CPP_FALLTHRU. (count_defs): Adjust falls through comment. (write_defs): Likewise. libgcc/ * soft-fp/op-common.h: Add _FP_FALLTHRU. * soft-fp/soft-fp.h (_FP_FALLTHRU): Define. libgo/ * runtime/heapdump.c (dumpefacetypes): Add break. libiberty/ * cp-demangle.c (d_print_mod): Add D_FALLTHRU. libstdc++-v3/ * libsupc++/hash_bytes.cc: Add [[gnu::fallthrough]]. diff --git gcc/gcc/Makefile.in gcc/gcc/Makefile.in index 7a0160f..1f6cb7d 100644 --- gcc/gcc/Makefile.in +++ gcc/gcc/Makefile.in @@ -218,6 +218,11 @@ libgcov-merge-tool.o-warn = -Wno-error gimple-match.o-warn = -Wno-unused generic-match.o-warn = -Wno-unused dfp.o-warn = -Wno-strict-aliasing +insn-attrtab.o-warn = -Wno-implicit-fallthrough +insn-dfatab.o-warn = -Wno-implicit-fallthrough +insn-latencytab.o-warn = -Wno-implicit-fallthrough +insn-output.o-warn = -Wno-implicit-fallthrough +insn-emit.o-warn = -Wno-implicit-fallthrough # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either diff --git gcc/gcc/alias.c gcc/gcc/alias.c index dd1dfd3..f4b5a92 100644 --- gcc/gcc/alias.c +++ gcc/gcc/alias.c @@ -1398,7 +1398,7 @@ find_base_value (rtx src) if (GET_CODE (src) != PLUS && GET_CODE (src) != MINUS) break; - /* ... fall through ... */ + /* fall through */ case PLUS: case MINUS: diff --git gcc/gcc/builtins.c gcc/gcc/builtins.c index 03a0dc8..703219f 100644 --- gcc/gcc/builtins.c +++ gcc/gcc/builtins.c @@ -2587,7 +2587,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target) { CASE_FLT_FN (BUILT_IN_IRINT): fallback_fn = BUILT_IN_LRINT; - /* FALLTHRU */ + gcc_fallthrough (); CASE_FLT_FN (BUILT_IN_LRINT): CASE_FLT_FN (BUILT_IN_LLRINT): builtin_optab = lrint_optab; @@ -2595,7 +2595,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target) CASE_FLT_FN (BUILT_IN_IROUND): fallback_fn = BUILT_IN_LROUND; - /* FALLTHRU */ + gcc_fallthrough (); CASE_FLT_FN (BUILT_IN_LROUND): CASE_FLT_FN (BUILT_IN_LLROUND): builtin_optab = lround_optab; @@ -5902,6 +5902,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, CASE_FLT_FN (BUILT_IN_ILOGB): if (! flag_unsafe_math_optimizations) break; + gcc_fallthrough (); CASE_FLT_FN (BUILT_IN_ISINF): CASE_FLT_FN (BUILT_IN_FINITE): case BUILT_IN_ISFINITE: 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"); diff --git gcc/gcc/c-family/c-common.c gcc/gcc/c-family/c-common.c index 9900e93..11adabb 100644 --- gcc/gcc/c-family/c-common.c +++ gcc/gcc/c-family/c-common.c @@ -1518,6 +1521,7 @@ warn_if_unused_value (const_tree exp, location_t locus) but front ends may define such. */ if (EXPRESSION_CLASS_P (exp) && TREE_OPERAND_LENGTH (exp) == 0) return false; + gcc_fallthrough (); warn: return warning_at (locus, OPT_Wunused_value, "value computed is not used"); @@ -11443,6 +11460,7 @@ resolve_overloaded_builtin (location_t loc, tree function, gcc_unreachable (); } /* Fallthrough to the normal processing. */ + gcc_fallthrough (); } case BUILT_IN_ATOMIC_EXCHANGE_N: case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N: @@ -11451,6 +11469,7 @@ resolve_overloaded_builtin (location_t loc, tree function, { fetch_op = false; /* Fallthrough to further processing. */ + gcc_fallthrough (); } case BUILT_IN_ATOMIC_ADD_FETCH_N: case BUILT_IN_ATOMIC_SUB_FETCH_N: @@ -11467,6 +11486,7 @@ resolve_overloaded_builtin (location_t loc, tree function, { orig_format = false; /* Fallthru for parameter processing. */ + gcc_fallthrough (); } case BUILT_IN_SYNC_FETCH_AND_ADD_N: case BUILT_IN_SYNC_FETCH_AND_SUB_N: @@ -12623,7 +12643,7 @@ scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1, case BIT_XOR_EXPR: case BIT_AND_EXPR: integer_only_op = true; - /* ... fall through ... */ + /* fall through */ case VEC_COND_EXPR: diff --git gcc/gcc/c-family/c-lex.c gcc/gcc/c-family/c-lex.c index 8f33d86..6ad529b 100644 --- gcc/gcc/c-family/c-lex.c +++ gcc/gcc/c-family/c-lex.c @@ -1142,6 +1142,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate) else error ("unsupported non-standard concatenation of string literals"); } + gcc_fallthrough (); case CPP_STRING: if (!concats) diff --git gcc/gcc/c-family/c-opts.c gcc/gcc/c-family/c-opts.c index c11e7e7..6053c91 100644 --- gcc/gcc/c-family/c-opts.c +++ gcc/gcc/c-family/c-opts.c @@ -436,7 +436,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, case OPT_ffreestanding: value = !value; - /* Fall through.... */ + /* Fall through. */ case OPT_fhosted: flag_hosted = value; flag_no_builtin = !value; diff --git gcc/gcc/c-family/c-pragma.c gcc/gcc/c-family/c-pragma.c index 277bc56..b218337 100644 --- gcc/gcc/c-family/c-pragma.c +++ gcc/gcc/c-family/c-pragma.c @@ -214,6 +214,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) align = maximum_field_alignment; break; } + gcc_fallthrough (); default: GCC_BAD2 ("alignment must be a small power of two, not %d", align); } diff --git gcc/gcc/c-family/c-pretty-print.c gcc/gcc/c-family/c-pretty-print.c index 704d21d..374bd1a 100644 --- gcc/gcc/c-family/c-pretty-print.c +++ gcc/gcc/c-family/c-pretty-print.c @@ -1662,7 +1662,7 @@ c_pretty_printer::postfix_expression (tree e) id_expression (TREE_OPERAND (e, 0)); break; } - /* else fall through. */ + /* fall through. */ default: primary_expression (e); diff --git gcc/gcc/c-family/cilk.c gcc/gcc/c-family/cilk.c index 8f34cd6..87ba9f6 100644 --- gcc/gcc/c-family/cilk.c +++ gcc/gcc/c-family/cilk.c @@ -1096,6 +1096,7 @@ extract_free_variables (tree t, struct wrapper_data *wd, case RESULT_DECL: if (wd->type != CILK_BLOCK_SPAWN) TREE_ADDRESSABLE (t) = 1; + gcc_fallthrough (); case VAR_DECL: case PARM_DECL: if (!is_global_var (t)) diff --git gcc/gcc/c/c-decl.c gcc/gcc/c/c-decl.c index 41aabeb..9ff35b2 100644 --- gcc/gcc/c/c-decl.c +++ gcc/gcc/c/c-decl.c @@ -1328,7 +1328,7 @@ pop_scope (void) set_type_context (TREE_TYPE (p), context); } - /* Fall through. */ + gcc_fallthrough (); /* Parameters go in DECL_ARGUMENTS, not BLOCK_VARS, and have already been put there by store_parm_decls. Unused- parameter warnings are handled by function.c. diff --git gcc/gcc/c/c-parser.c gcc/gcc/c/c-parser.c index 8952bca..ef99fbb 100644 --- gcc/gcc/c/c-parser.c +++ gcc/gcc/c/c-parser.c @@ -1549,6 +1552,7 @@ c_parser_external_declaration (c_parser *parser) } /* Else fall through, and yield a syntax error trying to parse as a declaration or function definition. */ + gcc_fallthrough (); default: decl_or_fndef: /* A declaration or a function definition (or, in Objective-C, @@ -5342,6 +5389,7 @@ c_parser_statement_after_labels (c_parser *parser, bool *if_p, default: expr_stmt: stmt = c_finish_expr_stmt (loc, c_parser_expression_conv (parser).value); + gcc_fallthrough (); expect_semicolon: c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); break; @@ -8171,6 +8219,7 @@ c_parser_postfix_expression (c_parser *parser) break; } /* Else fall through to report error. */ + gcc_fallthrough (); default: c_parser_error (parser, "expected expression"); expr.set_error (); diff --git gcc/gcc/c/c-typeck.c gcc/gcc/c/c-typeck.c index 0b5ab91..1d34971 100644 --- gcc/gcc/c/c-typeck.c +++ gcc/gcc/c/c-typeck.c @@ -605,7 +605,7 @@ composite_type (tree t1, tree t2) t1 = build_function_type (valtype, newargs); t1 = qualify_type (t1, t2); - /* ... falls through ... */ + gcc_fallthrough (); } default: @@ -4493,7 +4493,7 @@ build_unary_op (location_t location, return error_mark_node; } - /* ... fall through ... */ + /* fall through */ case ARRAY_REF: if (TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (TREE_OPERAND (arg, 0)))) @@ -4695,10 +4695,10 @@ c_mark_addressable (tree exp) return false; } - /* drops in */ + gcc_fallthrough (); case FUNCTION_DECL: TREE_ADDRESSABLE (x) = 1; - /* drops out */ + gcc_fallthrough (); default: return true; } @@ -12948,6 +12948,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) check_dup_generic: t = OMP_CLAUSE_DECL (c); + gcc_fallthrough (); check_dup_generic_t: if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL) { diff --git gcc/gcc/cfgexpand.c gcc/gcc/cfgexpand.c index 9a2837b..8482f55 100644 --- gcc/gcc/cfgexpand.c +++ gcc/gcc/cfgexpand.c @@ -4239,7 +4239,7 @@ expand_debug_expr (tree exp) set_mem_attributes (op0, exp, 0); return op0; } - /* Fall through... */ + /* Fall through. */ case INTEGER_CST: case REAL_CST: diff --git gcc/gcc/combine.c gcc/gcc/combine.c index 1becc3c..0764711 100644 --- gcc/gcc/combine.c +++ gcc/gcc/combine.c @@ -5135,7 +5135,7 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src) split = find_split_point (&XEXP (x, 2), insn, false); if (split) return split; - /* ... fall through ... */ + /* fall through */ case RTX_BIN_ARITH: case RTX_COMM_ARITH: case RTX_COMPARE: @@ -5143,7 +5143,7 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src) split = find_split_point (&XEXP (x, 1), insn, false); if (split) return split; - /* ... fall through ... */ + /* fall through */ case RTX_UNARY: /* Some machines have (and (shift ...) ...) insns. If X is not an AND, but XEXP (X, 0) is, use it as our split point. */ @@ -6955,6 +6955,7 @@ expand_compound_operation (rtx x) { case ZERO_EXTEND: unsignedp = 1; + gcc_fallthrough (); case SIGN_EXTEND: /* We can't necessarily use a const_int for a multiword mode; it depends on implicitly extending the value. @@ -6997,7 +6998,7 @@ expand_compound_operation (rtx x) case ZERO_EXTRACT: unsignedp = 1; - /* ... fall through ... */ + /* fall through */ case SIGN_EXTRACT: /* If the operand is a CLOBBER, just return it. */ @@ -8033,7 +8034,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) break; } - /* ... fall through ... */ + /* fall through */ case ASHIFTRT: lhs = XEXP (x, 0); @@ -8261,6 +8262,7 @@ canon_reg_for_combine (rtx x, rtx reg) if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1) || op2 != XEXP (x, 2)) return simplify_gen_ternary (GET_CODE (x), GET_MODE (x), GET_MODE (op0), op0, op1, op2); + gcc_fallthrough (); case RTX_OBJ: if (REG_P (x)) @@ -8527,7 +8529,7 @@ force_to_mode (rtx x, machine_mode mode, unsigned HOST_WIDE_INT mask, mode, smask, next_select); } - /* ... fall through ... */ + /* fall through */ case MULT: /* Substituting into the operands of a widening MULT is not likely to @@ -8598,6 +8600,7 @@ force_to_mode (rtx x, machine_mode mode, unsigned HOST_WIDE_INT mask, XEXP (XEXP (x, 0), 1)); return force_to_mode (x, mode, mask, next_select); } + gcc_fallthrough (); binop: /* For most binary operations, just propagate into the operation and @@ -8776,6 +8779,7 @@ force_to_mode (rtx x, machine_mode mode, unsigned HOST_WIDE_INT mask, if (mask == 1) x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), XEXP (x, 1)); + gcc_fallthrough (); shiftrt: @@ -8853,6 +8857,7 @@ force_to_mode (rtx x, machine_mode mode, unsigned HOST_WIDE_INT mask, /* (and (not FOO) CONST) is (not (or FOO (not CONST))), so we must use the full mask inside the NOT. */ mask = fuller_mask; + gcc_fallthrough (); unop: op0 = gen_lowpart_or_truncate (op_mode, @@ -10400,7 +10405,7 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode, continue; } - /* ... fall through ... */ + /* fall through */ case LSHIFTRT: case ASHIFT: @@ -11726,7 +11731,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) continue; } - /* ... fall through ... */ + /* fall through */ case SIGN_EXTRACT: tem = expand_compound_operation (op0); diff --git gcc/gcc/config/aarch64/aarch64-builtins.c gcc/gcc/config/aarch64/aarch64-builtins.c index 6b90b2a..fe37ea2 100644 --- gcc/gcc/config/aarch64/aarch64-builtins.c +++ gcc/gcc/config/aarch64/aarch64-builtins.c @@ -999,6 +999,7 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval, } /* Fall through - if the lane index isn't a constant then the next case will error. */ + gcc_fallthrough (); case SIMD_ARG_CONSTANT: constant_arg: if (!(*insn_data[icode].operand[opc].predicate) diff --git gcc/gcc/config/aarch64/predicates.md gcc/gcc/config/aarch64/predicates.md index 8f2726d..9a7b336 100644 --- gcc/gcc/config/aarch64/predicates.md +++ gcc/gcc/config/aarch64/predicates.md @@ -180,6 +180,7 @@ || GET_CODE (XEXP (op, 1)) != CONST_INT) return false; op = XEXP (op, 0); + gcc_fallthrough (); case SYMBOL_REF: return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_INITIAL_EXEC; @@ -201,6 +202,7 @@ || GET_CODE (XEXP (op, 1)) != CONST_INT) return false; op = XEXP (op, 0); + gcc_fallthrough (); case SYMBOL_REF: return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC; diff --git gcc/gcc/config/i386/i386.c gcc/gcc/config/i386/i386.c index ba35dce..ed6a019 100644 --- gcc/gcc/config/i386/i386.c +++ gcc/gcc/config/i386/i386.c @@ -9315,6 +9315,7 @@ pass_in_reg: error_p = 1; if (cum->float_in_sse < 2) break; + gcc_fallthrough (); case SFmode: if (cum->float_in_sse == -1) error_p = 1; @@ -9582,6 +9583,7 @@ pass_in_reg: error_p = 1; if (cum->float_in_sse < 2) break; + gcc_fallthrough (); case SFmode: if (cum->float_in_sse == -1) error_p = 1; @@ -10987,6 +10989,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, container = NULL; break; } + gcc_fallthrough (); default: container = construct_container (nat_mode, TYPE_MODE (type), @@ -15224,6 +15227,7 @@ ix86_legitimate_constant_p (machine_mode mode, rtx x) case XImode: if (!standard_sse_constant_p (x, mode)) return false; + gcc_fallthrough (); default: break; } @@ -17295,6 +17299,7 @@ print_reg (rtx x, int code, FILE *file) case 4: if (LEGACY_INT_REGNO_P (regno)) putc (msize == 8 && TARGET_64BIT ? 'r' : 'e', file); + gcc_fallthrough (); case 16: case 12: case 2: @@ -17704,6 +17709,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("eq_us", file); break; } + gcc_fallthrough (); case EQ: fputs ("eq", file); break; @@ -17713,6 +17719,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("nge", file); break; } + gcc_fallthrough (); case LT: fputs ("lt", file); break; @@ -17722,6 +17729,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("ngt", file); break; } + gcc_fallthrough (); case LE: fputs ("le", file); break; @@ -17734,6 +17742,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("neq_oq", file); break; } + gcc_fallthrough (); case NE: fputs ("neq", file); break; @@ -17743,6 +17752,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("ge", file); break; } + gcc_fallthrough (); case UNGE: fputs ("nlt", file); break; @@ -17752,6 +17762,7 @@ ix86_print_operand (FILE *file, rtx x, int code) fputs ("gt", file); break; } + gcc_fallthrough (); case UNGT: fputs ("nle", file); break; @@ -21499,6 +21510,7 @@ ix86_build_const_vector (machine_mode mode, bool vect, rtx value) case V4DImode: case V2DImode: gcc_assert (vect); + gcc_fallthrough (); case V16SFmode: case V8SFmode: case V4SFmode: @@ -22484,6 +22496,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. */ { @@ -29844,7 +29858,7 @@ ix86_sched_init_global (FILE *, int, int) core2i7_ifetch_block_max_insns = 6; break; } - /* ... Fall through ... */ + /* Fall through. */ default: targetm.sched.dfa_post_advance_cycle = NULL; targetm.sched.first_cycle_multipass_init = NULL; @@ -38728,6 +38742,7 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target, goto xop_rotl; case CODE_FOR_xop_rotlv16qi3: new_icode = CODE_FOR_rotlv16qi3; + gcc_fallthrough (); xop_rotl: if (CONST_INT_P (op)) { @@ -40115,6 +40130,7 @@ ix86_expand_args_builtin (const struct builtin_description *d, error ("the next to last argument must be an 8-bit immediate"); break; } + gcc_fallthrough (); case 1: error ("the last argument must be an 8-bit immediate"); break; @@ -40171,6 +40187,7 @@ ix86_expand_args_builtin (const struct builtin_description *d, case 5: pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op, args[2].op, args[3].op, args[4].op); + break; case 6: pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op, args[2].op, args[3].op, args[4].op, @@ -40545,6 +40562,7 @@ ix86_expand_round_builtin (const struct builtin_description *d, case 5: pat = GEN_FCN (icode) (target, args[0].op, args[1].op, args[2].op, args[3].op, args[4].op); + break; case 6: pat = GEN_FCN (icode) (target, args[0].op, args[1].op, args[2].op, args[3].op, args[4].op, @@ -41962,6 +41980,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, emit_insn (pat); return target; } + gcc_fallthrough (); case IX86_BUILTIN_RDRAND16_STEP: icode = CODE_FOR_rdrandhi_1; @@ -41976,6 +41995,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, case IX86_BUILTIN_RDRAND64_STEP: icode = CODE_FOR_rdranddi_1; mode0 = DImode; + gcc_fallthrough (); rdrand_step: op0 = gen_reg_rtx (mode0); @@ -42027,6 +42047,7 @@ rdrand_step: case IX86_BUILTIN_RDSEED64_STEP: icode = CODE_FOR_rdseeddi_1; mode0 = DImode; + gcc_fallthrough (); rdseed_step: op0 = gen_reg_rtx (mode0); @@ -42072,6 +42093,7 @@ rdseed_step: case IX86_BUILTIN_ADDCARRYX64: icode = CODE_FOR_addcarrydi; mode0 = DImode; + gcc_fallthrough (); handlecarry: arg0 = CALL_EXPR_ARG (exp, 0); /* unsigned char c_in. */ @@ -42152,6 +42174,7 @@ rdseed_step: icode = CODE_FOR_kortestzhi; mode0 = HImode; mode1 = CCZmode; + gcc_fallthrough (); kortest: arg0 = CALL_EXPR_ARG (exp, 0); /* Mask reg src1. */ @@ -42844,6 +42867,7 @@ rdseed_step: if (!TARGET_SSE) /* Emit a normal call if SSE isn't available. */ return expand_call (exp, target, ignore); + gcc_fallthrough (); default: return ix86_expand_args_builtin (d, exp, target); } @@ -46997,6 +47021,7 @@ ix86_expand_vector_init_one_var (bool mmx_ok, machine_mode mode, /* Use ix86_expand_vector_set in 64bit mode only. */ if (!TARGET_64BIT) return false; + gcc_fallthrough (); case V4DFmode: case V8SFmode: case V8SImode: diff --git gcc/gcc/config/rs6000/rs6000.c gcc/gcc/config/rs6000/rs6000.c index 6fe94d5..3e0a8a1 100644 --- gcc/gcc/config/rs6000/rs6000.c +++ gcc/gcc/config/rs6000/rs6000.c @@ -5461,7 +5461,7 @@ rs6000_builtin_vectorized_libmass (combined_fn fn, tree type_out, CASE_CFN_HYPOT: CASE_CFN_POW: n_args = 2; - /* fall through */ + gcc_fallthrough (); CASE_CFN_ACOS: CASE_CFN_ACOSH: @@ -14401,6 +14401,7 @@ altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp) break; case ALTIVEC_BUILTIN_LD_INTERNAL_2di: icode = CODE_FOR_vector_altivec_load_v2di; + break; case ALTIVEC_BUILTIN_LD_INTERNAL_1ti: icode = CODE_FOR_vector_altivec_load_v1ti; break; @@ -14462,6 +14463,7 @@ altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, break; case ALTIVEC_BUILTIN_ST_INTERNAL_2di: icode = CODE_FOR_vector_altivec_store_v2di; + break; case ALTIVEC_BUILTIN_ST_INTERNAL_1ti: icode = CODE_FOR_vector_altivec_store_v1ti; break; @@ -22535,6 +22537,7 @@ rs6000_emit_vector_compare_inner (enum rtx_code code, rtx op0, rtx op1) case GE: if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT) return NULL_RTX; + gcc_fallthrough (); case EQ: case GT: @@ -30236,6 +30239,7 @@ rs6000_adjust_cost (rtx_insn *insn, rtx link, rtx_insn *dep_insn, int cost) && (INSN_CODE (dep_insn) >= 0) && (get_attr_type (dep_insn) == TYPE_MFFGPR)) return 2; + gcc_fallthrough (); default: break; @@ -30272,6 +30276,7 @@ rs6000_adjust_cost (rtx_insn *insn, rtx link, rtx_insn *dep_insn, int cost) } } /* Fall through, no cost for output dependency. */ + gcc_fallthrough (); case REG_DEP_ANTI: /* Anti dependency; DEP_INSN reads a register that INSN writes some @@ -31418,6 +31423,7 @@ insn_must_be_first_in_group (rtx_insn *insn) case PROCESSOR_POWER5: if (is_cracked_insn (insn)) return true; + gcc_fallthrough (); case PROCESSOR_POWER4: if (is_microcoded_insn (insn)) return true; @@ -32335,6 +32341,7 @@ rs6000_handle_altivec_attribute (tree *node, case V4SImode: case V8HImode: case V16QImode: case V4SFmode: case V2DImode: case V2DFmode: result = type; + gcc_fallthrough (); default: break; } break; @@ -32345,6 +32352,7 @@ rs6000_handle_altivec_attribute (tree *node, case SImode: case V4SImode: result = bool_V4SI_type_node; break; case HImode: case V8HImode: result = bool_V8HI_type_node; break; case QImode: case V16QImode: result = bool_V16QI_type_node; + gcc_fallthrough (); default: break; } break; @@ -32352,6 +32360,7 @@ rs6000_handle_altivec_attribute (tree *node, switch (mode) { case V8HImode: result = pixel_V8HI_type_node; + gcc_fallthrough (); default: break; } default: break; diff --git gcc/gcc/config/rs6000/rs6000.md gcc/gcc/config/rs6000/rs6000.md index 5afae92..6e2b782 100644 --- gcc/gcc/config/rs6000/rs6000.md +++ gcc/gcc/config/rs6000/rs6000.md @@ -8148,6 +8148,7 @@ case 0: if (TARGET_STRING) return \"stswi %1,%P0,16\"; + gcc_fallthrough (); case 1: return \"#\"; case 2: @@ -8156,7 +8157,7 @@ if (TARGET_STRING && ! reg_overlap_mentioned_p (operands[0], operands[1])) return \"lswi %0,%P1,16\"; - /* ... fall through ... */ + /* fall through */ case 3: case 4: case 5: diff --git gcc/gcc/convert.c gcc/gcc/convert.c index e6b4d29..8f18ee4 100644 --- gcc/gcc/convert.c +++ gcc/gcc/convert.c @@ -164,6 +164,7 @@ convert_to_real_1 (tree type, tree expr, bool fold_p) -fmath-errno. */ if (flag_errno_math) break; + gcc_fallthrough (); CASE_MATHFN (ACOS) CASE_MATHFN (ACOSH) CASE_MATHFN (ASIN) @@ -184,6 +185,7 @@ convert_to_real_1 (tree type, tree expr, bool fold_p) /* The above functions are not safe to do this conversion. */ if (!flag_unsafe_math_optimizations) break; + gcc_fallthrough (); CASE_MATHFN (SQRT) CASE_MATHFN (FABS) CASE_MATHFN (LOGB) @@ -516,7 +518,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) /* Only convert nearbyint* if we can ignore math exceptions. */ if (flag_trapping_math) break; - /* ... Fall through ... */ + gcc_fallthrough (); CASE_FLT_FN (BUILT_IN_RINT): /* Only convert in ISO C99 mode and with -fno-math-errno. */ if (!targetm.libc_has_function (function_c99_misc) || flag_errno_math) diff --git gcc/gcc/cp/call.c gcc/gcc/cp/call.c index f929fb2..25f215f 100644 --- gcc/gcc/cp/call.c +++ gcc/gcc/cp/call.c @@ -2421,6 +2421,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case PREDECREMENT_EXPR: if (TREE_CODE (type1) == BOOLEAN_TYPE) return; + gcc_fallthrough (); case POSTINCREMENT_EXPR: case PREINCREMENT_EXPR: if (ARITHMETIC_TYPE_P (type1) || TYPE_PTROB_P (type1)) @@ -2457,6 +2458,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case UNARY_PLUS_EXPR: /* unary + */ if (TYPE_PTR_P (type1)) break; + gcc_fallthrough (); case NEGATE_EXPR: if (ARITHMETIC_TYPE_P (type1)) break; @@ -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)) @@ -2594,6 +2598,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case PLUS_EXPR: if (ARITHMETIC_TYPE_P (type1) && ARITHMETIC_TYPE_P (type2)) break; + gcc_fallthrough (); case ARRAY_REF: if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type1) && TYPE_PTROB_P (type2)) { @@ -2674,6 +2679,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)) @@ -3960,7 +3967,7 @@ build_integral_nontype_arg_conv (tree type, tree expr, tsubst_flags_t complain) if (complain & tf_error) error_at (loc, "conversion from %qT to %qT not considered for " "non-type template argument", t, type); - /* and fall through. */ + /* fall through. */ default: conv = NULL; @@ -5487,6 +5494,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1, case MODIFY_EXPR: if (code2 != NOP_EXPR) break; + gcc_fallthrough (); case COMPONENT_REF: case ARRAY_REF: memonly = true; @@ -6655,7 +6663,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (! MAYBE_CLASS_TYPE_P (totype)) return expr; - /* Else fall through. */ + /* Fall through. */ case ck_base: if (convs->kind == ck_base && !convs->need_temporary_p) { diff --git gcc/gcc/cp/class.c gcc/gcc/cp/class.c index b2db7f8..6cbd58b 100644 --- gcc/gcc/cp/class.c +++ gcc/gcc/cp/class.c @@ -7391,7 +7391,7 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp) *nonnull = 1; return TREE_TYPE (TREE_TYPE (instance)); } - /* fall through... */ + /* fall through. */ case TARGET_EXPR: case PARM_DECL: case RESULT_DECL: diff --git gcc/gcc/cp/constexpr.c gcc/gcc/cp/constexpr.c index 240c606..2ed90ee 100644 --- gcc/gcc/cp/constexpr.c +++ gcc/gcc/cp/constexpr.c @@ -3886,7 +3887,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, overflow_p); if (r) break; - /* else fall through */ + /* fall through */ case PLUS_EXPR: case MINUS_EXPR: @@ -5020,7 +5022,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, /* A destructor. */ if (TYPE_P (TREE_OPERAND (t, 0))) return true; - /* else fall through. */ + /* fall through. */ case REALPART_EXPR: case IMAGPART_EXPR: @@ -5095,6 +5097,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, } return false; } + gcc_fallthrough (); case INIT_EXPR: return RECUR (TREE_OPERAND (t, 1), rval); @@ -5172,6 +5175,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, case TRUTH_OR_EXPR: case TRUTH_ORIF_EXPR: tmp = boolean_false_node; + gcc_fallthrough (); truth: { tree op = TREE_OPERAND (t, 0); diff --git gcc/gcc/cp/cp-gimplify.c gcc/gcc/cp/cp-gimplify.c index 59953a6..2b28d86 100644 --- gcc/gcc/cp/cp-gimplify.c +++ gcc/gcc/cp/cp-gimplify.c @@ -659,7 +659,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) cp_gimplify_init_expr (expr_p); if (TREE_CODE (*expr_p) != INIT_EXPR) return GS_OK; - /* Otherwise fall through. */ + /* Fall through. */ case MODIFY_EXPR: modify_expr_case: { @@ -2067,6 +2067,7 @@ cp_fold (tree x) case VIEW_CONVERT_EXPR: rval_ops = false; + gcc_fallthrough (); case CONVERT_EXPR: case NOP_EXPR: case NON_LVALUE_EXPR: @@ -2115,6 +2116,7 @@ cp_fold (tree x) case REALPART_EXPR: case IMAGPART_EXPR: rval_ops = false; + gcc_fallthrough (); case CONJ_EXPR: case FIX_TRUNC_EXPR: case FLOAT_EXPR: @@ -2167,6 +2169,7 @@ cp_fold (tree x) case COMPOUND_EXPR: case MODIFY_EXPR: rval_ops = false; + gcc_fallthrough (); case POINTER_PLUS_EXPR: case PLUS_EXPR: case MINUS_EXPR: diff --git gcc/gcc/cp/cvt.c gcc/gcc/cp/cvt.c index 85b3047..977c665 100644 --- gcc/gcc/cp/cvt.c +++ gcc/gcc/cp/cvt.c @@ -1663,7 +1663,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain) case INTEGER_TYPE: if ((desires & WANT_NULL) && null_ptr_cst_p (expr)) return expr; - /* else fall through... */ + /* fall through. */ case BOOLEAN_TYPE: return (desires & WANT_INT) ? expr : NULL_TREE; diff --git gcc/gcc/cp/cxx-pretty-print.c gcc/gcc/cp/cxx-pretty-print.c index 192b26c..1fd42c7 100644 --- gcc/gcc/cp/cxx-pretty-print.c +++ gcc/gcc/cp/cxx-pretty-print.c @@ -142,6 +142,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case OVERLOAD: t = OVL_CURRENT (t); + gcc_fallthrough (); case VAR_DECL: case PARM_DECL: case CONST_DECL: @@ -153,6 +154,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case USING_DECL: case TEMPLATE_DECL: t = DECL_NAME (t); + gcc_fallthrough (); case IDENTIFIER_NODE: if (t == NULL) @@ -280,6 +282,7 @@ pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t) functions and some function templates. */ case OVERLOAD: t = OVL_CURRENT (t); + gcc_fallthrough (); case FUNCTION_DECL: if (DECL_FUNCTION_MEMBER_P (t)) pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); @@ -331,7 +334,7 @@ cxx_pretty_printer::constant (tree t) pp_string (this, "nullptr"); break; } - /* else fall through. */ + /* fall through. */ default: c_pretty_printer::constant (t); @@ -417,6 +420,7 @@ cxx_pretty_printer::primary_expression (tree t) case BASELINK: t = BASELINK_FUNCTIONS (t); + gcc_fallthrough (); case VAR_DECL: case PARM_DECL: case FIELD_DECL: @@ -872,7 +876,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) pp_cxx_qualified_id (pp, t); break; } - /* Else fall through. */ + /* Fall through. */ case MEMBER_REF: case DOTSTAR_EXPR: pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0)); @@ -1057,6 +1061,7 @@ cxx_pretty_printer::expression (tree t) case OVERLOAD: t = OVL_CURRENT (t); + gcc_fallthrough (); case VAR_DECL: case PARM_DECL: case FIELD_DECL: @@ -1267,7 +1272,9 @@ cxx_pretty_printer::declaration_specifiers (tree t) else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) declaration_specifiers (TREE_TYPE (TREE_TYPE (t))); else - default: + c_pretty_printer::declaration_specifiers (t); + break; + default: c_pretty_printer::declaration_specifiers (t); break; } @@ -1364,7 +1371,7 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t) pp_cxx_ptr_operator (pp, t); break; } - /* else fall through */ + /* fall through */ default: if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t))) @@ -1406,6 +1413,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t) pp_star (pp); break; } + gcc_fallthrough (); case OFFSET_TYPE: if (TYPE_PTRMEM_P (t)) { @@ -1416,7 +1424,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t) pp_cxx_cv_qualifier_seq (pp, t); break; } - /* else fall through. */ + /* fall through. */ default: pp_unsupported_tree (pp, t); diff --git gcc/gcc/cp/error.c gcc/gcc/cp/error.c index 69a40cc..637bce2 100644 --- gcc/gcc/cp/error.c +++ gcc/gcc/cp/error.c @@ -450,7 +450,7 @@ dump_type (cxx_pretty_printer *pp, tree t, int flags) ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); break; } - /* Else fall through. */ + /* Fall through. */ case TEMPLATE_DECL: case NAMESPACE_DECL: @@ -576,6 +576,7 @@ dump_type (cxx_pretty_printer *pp, tree t, int flags) default: pp_unsupported_tree (pp, t); /* Fall through to error. */ + gcc_fallthrough (); case ERROR_MARK: pp_string (pp, M_("<type error>")); @@ -1065,7 +1066,7 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags) dump_type (pp, DECL_CONTEXT (t), flags); break; } - /* Else fall through. */ + /* Fall through. */ case FIELD_DECL: case PARM_DECL: dump_simple_decl (pp, t, TREE_TYPE (t), flags); @@ -1277,6 +1278,7 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags) default: pp_unsupported_tree (pp, t); /* Fall through to error. */ + gcc_fallthrough (); case ERROR_MARK: pp_string (pp, M_("<declaration error>")); @@ -2509,6 +2511,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) goto cast; case DYNAMIC_CAST_EXPR: pp_cxx_ws_string (pp, "dynamic_cast"); + gcc_fallthrough (); cast: pp_cxx_begin_template_argument_list (pp); dump_type (pp, TREE_TYPE (t), flags); @@ -2776,6 +2779,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) default: pp_unsupported_tree (pp, t); /* fall through to ERROR_MARK... */ + gcc_fallthrough (); case ERROR_MARK: pp_string (pp, M_("<expression error>")); break; diff --git gcc/gcc/cp/mangle.c gcc/gcc/cp/mangle.c index d5b26d6..eacc22a 100644 --- gcc/gcc/cp/mangle.c +++ gcc/gcc/cp/mangle.c @@ -2051,7 +2051,7 @@ write_type (tree type) ++is_builtin_type; break; } - /* else fall through. */ + /* fall through. */ case TEMPLATE_PARM_INDEX: write_template_param (type); break; diff --git gcc/gcc/cp/method.c gcc/gcc/cp/method.c index cd8faaf..72c9717 100644 --- gcc/gcc/cp/method.c +++ gcc/gcc/cp/method.c @@ -1402,6 +1402,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, case sfk_move_constructor: case sfk_move_assignment: move_p = true; + gcc_fallthrough (); case sfk_copy_constructor: case sfk_copy_assignment: copy_arg_p = true; diff --git gcc/gcc/cp/name-lookup.c gcc/gcc/cp/name-lookup.c index 7c3942a52..4694887 100644 --- gcc/gcc/cp/name-lookup.c +++ gcc/gcc/cp/name-lookup.c @@ -5659,6 +5659,7 @@ arg_assoc_type (struct arg_lookup *k, tree type) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (type)) return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type)); + gcc_fallthrough (); case UNION_TYPE: return arg_assoc_class (k, type); case POINTER_TYPE: diff --git gcc/gcc/cp/parser.c gcc/gcc/cp/parser.c index b71b9e5..1364f68 100644 --- gcc/gcc/cp/parser.c +++ gcc/gcc/cp/parser.c @@ -1266,7 +1266,7 @@ cp_lexer_print_token (FILE * stream, cp_token *token) For example, `struct' is mapped to an INTEGER_CST. */ if (!identifier_p (token->u.value)) break; - /* else fall through */ + /* fall through */ case CPP_NAME: fputs (IDENTIFIER_POINTER (token->u.value), stream); break; @@ -3488,6 +3488,7 @@ cp_parser_skip_to_end_of_statement (cp_parser* parser) cp_lexer_consume_token (parser->lexer); return; } + gcc_fallthrough (); case CPP_OPEN_BRACE: ++nesting_depth; @@ -5139,6 +5153,7 @@ cp_parser_primary_expression (cp_parser *parser, cp_parser_skip_to_end_of_block_or_statement (parser); return error_mark_node; } + gcc_fallthrough (); default: cp_parser_error (parser, "expected primary-expression"); return error_mark_node; @@ -12893,6 +12932,7 @@ cp_parser_storage_class_specifier_opt (cp_parser* parser) if (cxx_dialect != cxx98) return NULL_TREE; /* Fall through for C++98. */ + gcc_fallthrough (); case RID_REGISTER: case RID_STATIC: @@ -14012,6 +14052,7 @@ cp_parser_operator (cp_parser* parser) case CPP_UTF8STRING: case CPP_UTF8STRING_USERDEF: utf8 = true; + gcc_fallthrough (); case CPP_STRING: case CPP_WSTRING: case CPP_STRING16: @@ -27164,6 +27219,7 @@ cp_parser_skip_to_end_of_template_parameter_list (cp_parser* parser) } /* Fall through for C++0x, so we handle the second `>' in the `>>'. */ + gcc_fallthrough (); case CPP_GREATER: if (!nesting_depth && level-- == 0) @@ -27581,6 +27637,7 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi) parser->in_template_argument_list_p = saved_italp; break; } + gcc_fallthrough (); case CPP_CLOSE_PAREN: case CPP_ELLIPSIS: /* If we run into a non-nested `;', `}', or `]', @@ -27619,6 +27676,7 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi) /* Fall through for C++0x, which treats the `>>' operator like two `>' tokens in certain cases. */ + gcc_fallthrough (); case CPP_GREATER: if (depth == 0) @@ -33261,6 +33319,7 @@ cp_parser_omp_for_cond (cp_parser *parser, tree decl, enum tree_code code) if (code == CILK_SIMD || code == CILK_FOR) break; /* Fall through: OpenMP disallows NE_EXPR. */ + gcc_fallthrough (); default: return error_mark_node; } diff --git gcc/gcc/cp/pt.c gcc/gcc/cp/pt.c index d7f3808..c92898e 100644 --- gcc/gcc/cp/pt.c +++ gcc/gcc/cp/pt.c @@ -3450,6 +3450,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) case TEMPLATE_TYPE_PARM: t = TYPE_MAIN_VARIANT (t); + gcc_fallthrough (); case TEMPLATE_TEMPLATE_PARM: /* If the placeholder appears in the decl-specifier-seq of a function parameter pack (14.6.3), or the type-specifier-seq of a type-id that @@ -11454,7 +11455,7 @@ tsubst_aggr_type (tree t, if (TYPE_PTRMEMFUNC_P (t)) return tsubst (TYPE_PTRMEMFUNC_FN_TYPE (t), args, complain, in_decl); - /* Else fall through. */ + /* Fall through. */ case ENUMERAL_TYPE: case UNION_TYPE: if (TYPE_TEMPLATE_INFO (t) && uses_template_parms (t)) @@ -20233,6 +20234,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, if (is_overloaded_fn (parm) || type_unknown_p (parm)) return unify_success (explain_p); gcc_assert (EXPR_P (parm)); + gcc_fallthrough (); expr: /* We must be looking at an expression. This can happen with something like: diff --git gcc/gcc/cp/semantics.c gcc/gcc/cp/semantics.c index 19daeff..74a3912 100644 --- gcc/gcc/cp/semantics.c +++ gcc/gcc/cp/semantics.c @@ -6011,6 +6011,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) } else t = OMP_CLAUSE_DECL (c); + gcc_fallthrough (); check_dup_generic_t: if (t == current_class_ptr && (ort != C_ORT_OMP_DECLARE_SIMD @@ -6066,6 +6067,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) bitmap_set_bit (&generic_head, DECL_UID (t)); if (!field_ok) break; + gcc_fallthrough (); handle_field_decl: if (!remove && TREE_CODE (t) == FIELD_DECL @@ -6212,11 +6214,13 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) OMP_CLAUSE_OPERAND (c, 1) = t; } /* Check operand 0, the num argument. */ + gcc_fallthrough (); case OMP_CLAUSE_WORKER: case OMP_CLAUSE_VECTOR: if (OMP_CLAUSE_OPERAND (c, 0) == NULL_TREE) break; + gcc_fallthrough (); case OMP_CLAUSE_NUM_TASKS: case OMP_CLAUSE_NUM_TEAMS: @@ -6818,6 +6822,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) && TREE_CODE (OMP_CLAUSE_DECL (c)) == COMPONENT_REF) bitmap_set_bit (&map_field_head, DECL_UID (t)); } + gcc_fallthrough (); handle_map_references: if (!remove && !processing_template_decl @@ -8879,6 +8884,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p, break; } /* Fall through for fields that aren't bitfields. */ + gcc_fallthrough (); case FUNCTION_DECL: case VAR_DECL: diff --git gcc/gcc/cp/tree.c gcc/gcc/cp/tree.c index 6adeb63..bd7393f 100644 --- gcc/gcc/cp/tree.c +++ gcc/gcc/cp/tree.c @@ -141,11 +141,13 @@ lvalue_kind (const_tree ref) lvalues. */ if (! TREE_STATIC (ref)) return clk_none; + gcc_fallthrough (); case VAR_DECL: if (TREE_READONLY (ref) && ! TREE_STATIC (ref) && DECL_LANG_SPECIFIC (ref) && DECL_IN_AGGR_P (ref)) return clk_none; + gcc_fallthrough (); case INDIRECT_REF: case ARROW_EXPR: case ARRAY_REF: diff --git gcc/gcc/cp/typeck.c gcc/gcc/cp/typeck.c index d4bfb11..3639c7a 100644 --- gcc/gcc/cp/typeck.c +++ gcc/gcc/cp/typeck.c @@ -1306,6 +1306,7 @@ structural_comptypes (tree t1, tree t2, int strict) if (TYPE_REF_IS_RVALUE (t1) != TYPE_REF_IS_RVALUE (t2)) return false; /* fall through to checks for pointer types */ + gcc_fallthrough (); case POINTER_TYPE: if (TYPE_MODE (t1) != TYPE_MODE (t2) @@ -4260,6 +4261,7 @@ cp_build_binary_op (location_t location, } /* The pointer - int case is just like pointer + int; fall through. */ + gcc_fallthrough (); case PLUS_EXPR: if ((code0 == POINTER_TYPE || code1 == POINTER_TYPE) && (code0 == INTEGER_TYPE || code1 == INTEGER_TYPE)) @@ -7532,6 +7534,7 @@ cp_build_modify_expr (location_t loc, tree lhs, enum tree_code modifycode, TREE_OPERAND (lhs, 0), TREE_OPERAND (lhs, 1)); /* Fall through. */ + gcc_fallthrough (); /* Handle (a ? b : c) used as an "lvalue". */ case COND_EXPR: diff --git gcc/gcc/cselib.c gcc/gcc/cselib.c index 14c7b32..24b1976 100644 --- 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/dbxout.c gcc/gcc/dbxout.c index da0987f..ad256c7 100644 --- gcc/gcc/dbxout.c +++ gcc/gcc/dbxout.c @@ -2867,7 +2867,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) disguised VAR_DECLs like Out parameters in Ada. */ gcc_assert (TREE_CODE (decl) == VAR_DECL); - /* ... fall through ... */ + /* fall through */ case RESULT_DECL: case VAR_DECL: diff --git gcc/gcc/df-scan.c gcc/gcc/df-scan.c index 19d8e0f..9cd647a 100644 --- gcc/gcc/df-scan.c +++ gcc/gcc/df-scan.c @@ -2875,7 +2875,7 @@ df_uses_record (struct df_collection_rec *collection_rec, df_uses_record (collection_rec, loc, ref_type, bb, insn_info, flags); return; } - /* ... Fall through ... */ + /* Fall through */ case REG: df_ref_record (DF_REF_REGULAR, collection_rec, diff --git gcc/gcc/dojump.c gcc/gcc/dojump.c index 58f1e03..6e2435b 100644 --- gcc/gcc/dojump.c +++ gcc/gcc/dojump.c @@ -461,12 +461,14 @@ do_jump (tree exp, rtx_code_label *if_false_label, || TREE_CODE (TREE_OPERAND (exp, 0)) == ARRAY_REF || TREE_CODE (TREE_OPERAND (exp, 0)) == ARRAY_RANGE_REF) goto normal; + gcc_fallthrough (); case CONVERT_EXPR: /* If we are narrowing the operand, we have to do the compare in the narrower mode. */ if ((TYPE_PRECISION (TREE_TYPE (exp)) < TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (exp, 0))))) goto normal; + gcc_fallthrough (); case NON_LVALUE_EXPR: case ABS_EXPR: case NEGATE_EXPR: @@ -610,6 +612,7 @@ do_jump (tree exp, rtx_code_label *if_false_label, goto normal; /* Boolean comparisons can be compiled as TRUTH_AND_EXPR. */ + gcc_fallthrough (); case TRUTH_AND_EXPR: /* High branch cost, expand as the bitwise AND of the conditions. diff --git gcc/gcc/dwarf2out.c gcc/gcc/dwarf2out.c index e3cb586..dc751bb 100644 --- gcc/gcc/dwarf2out.c +++ gcc/gcc/dwarf2out.c @@ -13334,6 +13334,8 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, if (!subreg_lowpart_p (rtl)) break; inner = SUBREG_REG (rtl); + /* XXX Really fallthru? */ + gcc_fallthrough (); case TRUNCATE: if (inner == NULL_RTX) inner = XEXP (rtl, 0); @@ -13602,6 +13604,8 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, initialized); break; } + /* XXX Really fallthru? */ + gcc_fallthrough (); symref: mem_loc_result = new_addr_loc_descr (rtl, dtprel_false); @@ -13671,7 +13675,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, : -GET_MODE_UNIT_SIZE (mem_mode), mode)); - /* ... fall through ... */ + /* fall through */ case PLUS: plus: @@ -15597,7 +15601,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, if (!resolve_args_picking_1 (l->dw_loc_next, frame_offset_, dpi, frame_offsets)) return false; - /* Fall through... */ + /* Fall through. */ case DW_OP_skip: l = l->dw_loc_oprnd1.v.val_loc; @@ -16350,7 +16354,7 @@ loc_list_from_tree_1 (tree loc, int want_address, TREE_OPERAND (loc, 1), TREE_OPERAND (loc, 0)); } - /* ... fall through ... */ + /* fall through */ case COND_EXPR: { @@ -19652,6 +19656,7 @@ gen_formal_parameter_die (tree node, tree origin, bool emit_name_p, } if (origin == NULL && DECL_ARTIFICIAL (node)) add_AT_flag (parm_die, DW_AT_artificial, 1); + gcc_fallthrough (); add_location: if (node && node != origin) equate_decl_number_to_die (node, parm_die); diff --git gcc/gcc/expmed.c gcc/gcc/expmed.c index f776e54..c78ac91 100644 --- gcc/gcc/expmed.c +++ gcc/gcc/expmed.c @@ -4465,6 +4465,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, } break; } + gcc_fallthrough (); fail1: delete_insns_since (last); break; @@ -5172,7 +5173,7 @@ make_tree (tree type, rtx x) t = SYMBOL_REF_DECL (x); if (t) return fold_convert (type, build_fold_addr_expr (t)); - /* else fall through. */ + /* fall through. */ default: t = build_decl (RTL_LOCATION (x), VAR_DECL, NULL_TREE, type); diff --git gcc/gcc/expr.c gcc/gcc/expr.c index 1cb233c..e55fee2 100644 --- gcc/gcc/expr.c +++ gcc/gcc/expr.c @@ -8407,6 +8407,8 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, offset to have matching modes. */ else if (TYPE_PRECISION (sizetype) > TYPE_PRECISION (type)) treeop1 = fold_convert_loc (loc, type, treeop1); + /* XXX Really fallthru? */ + gcc_fallthrough (); case PLUS_EXPR: /* If we are adding a constant, a VAR_DECL that is sp, fp, or ap, and @@ -9575,9 +9577,9 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, switch (TREE_CODE_LENGTH (code)) { default: - case 3: treeop2 = TREE_OPERAND (exp, 2); - case 2: treeop1 = TREE_OPERAND (exp, 1); - case 1: treeop0 = TREE_OPERAND (exp, 0); + case 3: treeop2 = TREE_OPERAND (exp, 2); gcc_fallthrough (); + case 2: treeop1 = TREE_OPERAND (exp, 1); gcc_fallthrough (); + case 1: treeop0 = TREE_OPERAND (exp, 0); gcc_fallthrough (); case 0: break; } ops.code = code; @@ -9749,11 +9751,12 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, && (TREE_STATIC (exp) || DECL_EXTERNAL (exp))) layout_decl (exp, 0); - /* ... fall through ... */ + /* fall through */ case FUNCTION_DECL: case RESULT_DECL: decl_rtl = DECL_RTL (exp); + gcc_fallthrough (); expand_decl_rtl: gcc_assert (decl_rtl); @@ -9957,7 +9960,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, return original_target; } - /* ... fall through ... */ + /* fall through */ case STRING_CST: temp = expand_expr_constant (exp, 1, modifier); diff --git gcc/gcc/final.c gcc/gcc/final.c index 5b04311..1e99f74 100644 --- gcc/gcc/final.c +++ gcc/gcc/final.c @@ -2096,9 +2096,11 @@ output_alternate_entry_point (FILE *file, rtx_insn *insn) case LABEL_WEAK_ENTRY: #ifdef ASM_WEAKEN_LABEL ASM_WEAKEN_LABEL (file, name); + gcc_fallthrough (); #endif case LABEL_GLOBAL_ENTRY: targetm.asm_out.globalize_label (file, name); + gcc_fallthrough (); case LABEL_STATIC_ENTRY: #ifdef ASM_OUTPUT_TYPE_DIRECTIVE ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); diff --git gcc/gcc/fold-const.c gcc/gcc/fold-const.c index c5d9a79..8b054a9 100644 --- gcc/gcc/fold-const.c +++ gcc/gcc/fold-const.c @@ -1300,7 +1300,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2) return do_mpc_arg2 (arg1, arg2, type, /* do_nonfinite= */ folding_initializer, mpc_div); - /* Fallthru ... */ + /* Fallthru. */ case TRUNC_DIV_EXPR: case CEIL_DIV_EXPR: case FLOOR_DIV_EXPR: @@ -3696,7 +3696,7 @@ fold_truth_not_expr (location_t loc, tree arg) if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE) return build1_loc (loc, TRUTH_NOT_EXPR, type, arg); - /* ... fall through ... */ + /* fall through */ case FLOAT_EXPR: loc1 = expr_location_or (TREE_OPERAND (arg, 0), loc); @@ -4460,6 +4460,7 @@ make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1, if (TYPE_OVERFLOW_UNDEFINED (arg0_type)) *strict_overflow_p = true; + gcc_fallthrough (); normalize: /* Check for an unsigned range which has wrapped around the maximum @@ -5101,6 +5102,7 @@ fold_cond_expr_with_comparison (location_t loc, tree type, case UNLT_EXPR: if (flag_trapping_math) break; + gcc_fallthrough (); case LE_EXPR: case LT_EXPR: if (TYPE_UNSIGNED (TREE_TYPE (arg1))) @@ -9452,6 +9454,7 @@ fold_binary_loc (location_t loc, } } } + gcc_fallthrough (); bit_rotate: /* (A << C1) + (A >> C2) if A is unsigned and C1+C2 is the size of A @@ -9541,6 +9544,7 @@ fold_binary_loc (location_t loc, } } } + gcc_fallthrough (); associate: /* In most languages, can't associate operations on floats through @@ -10323,6 +10327,8 @@ fold_binary_loc (location_t loc, /* If first arg is constant zero, return it. */ if (integer_zerop (arg0)) return fold_convert_loc (loc, type, arg0); + /* XXX Really fallthru? */ + gcc_fallthrough (); case TRUTH_AND_EXPR: /* If either arg is constant true, drop it. */ if (TREE_CODE (arg0) == INTEGER_CST && ! integer_zerop (arg0)) @@ -10378,6 +10384,8 @@ fold_binary_loc (location_t loc, /* If first arg is constant true, return it. */ if (TREE_CODE (arg0) == INTEGER_CST && ! integer_zerop (arg0)) return fold_convert_loc (loc, type, arg0); + /* XXX Really fallthru? */ + gcc_fallthrough (); case TRUTH_OR_EXPR: /* If either arg is constant zero, drop it. */ if (TREE_CODE (arg0) == INTEGER_CST && integer_zerop (arg0)) @@ -11222,7 +11230,7 @@ contains_label_1 (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) case GOTO_EXPR: *walk_subtrees = 0; - /* ... fall through ... */ + /* fall through */ default: return NULL_TREE; @@ -12587,7 +12595,7 @@ multiple_of_p (tree type, const_tree top, const_tree bottom) < TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (top, 0))))) return 0; - /* .. fall through ... */ + /* fall through */ case SAVE_EXPR: return multiple_of_p (type, TREE_OPERAND (top, 0), bottom); diff --git gcc/gcc/fortran/arith.c gcc/gcc/fortran/arith.c index 47a5504..8af7540 100644 --- gcc/gcc/fortran/arith.c +++ gcc/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 gcc/gcc/fortran/array.c gcc/gcc/fortran/array.c index 03c8b17..2330998 100644 --- gcc/gcc/fortran/array.c +++ gcc/gcc/fortran/array.c @@ -2323,6 +2323,7 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end) mpz_mul (*end, *end, stride); mpz_add (*end, *end, lower); } + gcc_fallthrough (); cleanup: mpz_clear (upper); diff --git gcc/gcc/fortran/decl.c gcc/gcc/fortran/decl.c index 1b62833..6c6842f 100644 --- gcc/gcc/fortran/decl.c +++ gcc/gcc/fortran/decl.c @@ -3911,6 +3911,7 @@ match_attr_spec (void) d = DECL_CODIMENSION; break; } + gcc_fallthrough (); case 'n': if (match_string_p ("tiguous")) { diff --git gcc/gcc/fortran/dependency.c gcc/gcc/fortran/dependency.c index a873dbe..fd174d9 100644 --- gcc/gcc/fortran/dependency.c +++ gcc/gcc/fortran/dependency.c @@ -2250,6 +2250,7 @@ dep_ref (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse) /* Overlap codes are in order of priority. We only need to know the worst one.*/ + gcc_fallthrough (); update_fin_dep: if (this_dep > fin_dep) diff --git gcc/gcc/fortran/dump-parse-tree.c gcc/gcc/fortran/dump-parse-tree.c index f507434..1eb8777 100644 --- gcc/gcc/fortran/dump-parse-tree.c +++ gcc/gcc/fortran/dump-parse-tree.c @@ -2162,6 +2162,7 @@ show_code_node (int level, gfc_code *c) case EXEC_FLUSH: fputs ("FLUSH", dumpfile); + gcc_fallthrough (); show_filepos: fp = c->ext.filepos; @@ -2378,6 +2379,7 @@ show_code_node (int level, gfc_code *c) case EXEC_WRITE: fputs ("WRITE", dumpfile); + gcc_fallthrough (); show_dt: dt = c->ext.dt; @@ -2468,6 +2470,7 @@ show_code_node (int level, gfc_code *c) fputs (" SIGN=", dumpfile); show_expr (dt->sign); } + gcc_fallthrough (); show_dt_code: for (c = c->block->next; c; c = c->next) diff --git gcc/gcc/fortran/frontend-passes.c gcc/gcc/fortran/frontend-passes.c index d4dee47..317283f 100644 --- gcc/gcc/fortran/frontend-passes.c +++ gcc/gcc/fortran/frontend-passes.c @@ -1442,7 +1442,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: @@ -3310,6 +3310,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 gcc/gcc/fortran/parse.c gcc/gcc/fortran/parse.c index bd7b138..b9f6c8c 100644 --- gcc/gcc/fortran/parse.c +++ gcc/gcc/fortran/parse.c @@ -1262,7 +1262,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. */ @@ -3699,6 +3699,7 @@ declSt: unexpected_statement (st); break; } + gcc_fallthrough (); default: break; diff --git gcc/gcc/fortran/primary.c gcc/gcc/fortran/primary.c index c2faa0f..799ebc9 100644 --- gcc/gcc/fortran/primary.c +++ gcc/gcc/fortran/primary.c @@ -1686,18 +1686,21 @@ match_arg_list_function (gfc_actual_arglist *result) result->name = "%LOC"; break; } + gcc_fallthrough (); case 'r': if (strncmp (name, "ref", 3) == 0) { result->name = "%REF"; break; } + gcc_fallthrough (); case 'v': if (strncmp (name, "val", 3) == 0) { result->name = "%VAL"; break; } + gcc_fallthrough (); default: m = MATCH_ERROR; goto cleanup; @@ -3007,6 +3010,7 @@ gfc_match_rvalue (gfc_expr **result) m = gfc_match_varspec (e, 0, false, true); break; } + gcc_fallthrough (); /* Match a function reference. */ function0: @@ -3412,6 +3416,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 gcc/gcc/fortran/resolve.c gcc/gcc/fortran/resolve.c index 1fc540a..7340454 100644 --- gcc/gcc/fortran/resolve.c +++ gcc/gcc/fortran/resolve.c @@ -3542,7 +3542,7 @@ resolve_operator (gfc_expr *e) if (!gfc_resolve_expr (e->value.op.op2)) return false; - /* Fall through... */ + /* Fall through. */ case INTRINSIC_NOT: case INTRINSIC_UPLUS: @@ -3660,7 +3660,7 @@ resolve_operator (gfc_expr *e) goto bad_op; } - /* Fall through... */ + /* Fall through. */ case INTRINSIC_EQ: case INTRINSIC_EQ_OS: @@ -5419,14 +5419,17 @@ fixup_charlen (gfc_expr *e) { case EXPR_OP: gfc_resolve_character_operator (e); + gcc_fallthrough (); case EXPR_ARRAY: if (e->expr_type == EXPR_ARRAY) gfc_resolve_character_array_constructor (e); + gcc_fallthrough (); case EXPR_SUBSTRING: if (!e->ts.u.cl && e->ref) gfc_resolve_substring_charlen (e); + gcc_fallthrough (); default: if (!e->ts.u.cl) @@ -7301,7 +7304,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code, bool *array_alloc_wo_spec) && ar->stride[i] == NULL) break; - /* Fall Through... */ + /* Fall through. */ case DIMEN_UNKNOWN: case DIMEN_VECTOR: diff --git gcc/gcc/fortran/trans-array.c gcc/gcc/fortran/trans-array.c index e95c8dd..2ef6263 100644 --- gcc/gcc/fortran/trans-array.c +++ gcc/gcc/fortran/trans-array.c @@ -4031,6 +4031,7 @@ done: continue; } /* Otherwise fall through GFC_SS_FUNCTION. */ + gcc_fallthrough (); } case GFC_ISYM_LCOBOUND: case GFC_ISYM_UCOBOUND: @@ -4041,6 +4041,7 @@ done: continue; } + gcc_fallthrough (); case GFC_SS_CONSTRUCTOR: case GFC_SS_FUNCTION: for (n = 0; n < ss->dimen; n++) diff --git gcc/gcc/fortran/trans-expr.c gcc/gcc/fortran/trans-expr.c index e3559f4..7e8dc6a 100644 --- gcc/gcc/fortran/trans-expr.c +++ gcc/gcc/fortran/trans-expr.c @@ -2102,6 +2102,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 gcc/gcc/fortran/trans-intrinsic.c gcc/gcc/fortran/trans-intrinsic.c index c655540..0623338 100644 --- gcc/gcc/fortran/trans-intrinsic.c +++ gcc/gcc/fortran/trans-intrinsic.c @@ -2136,6 +2136,7 @@ conv_intrinsic_cobound (gfc_se * se, gfc_expr * expr) bound = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type, bound, gfc_index_one_node); + gcc_fallthrough (); case 1: break; default: @@ -5329,7 +5330,7 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr) break; } - /* Otherwise fall through. */ + /* Fall through. */ default: /* Anybody stupid enough to do this deserves inefficient code. */ diff --git gcc/gcc/fortran/trans-stmt.c gcc/gcc/fortran/trans-stmt.c index 6e4e2a7..b3a4d86 100644 --- gcc/gcc/fortran/trans-stmt.c +++ gcc/gcc/fortran/trans-stmt.c @@ -4969,6 +4969,7 @@ gfc_trans_where_2 (gfc_code * code, tree mask, bool invert, case EXEC_ASSIGN: expr1 = cnext->expr1; expr2 = cnext->expr2; + gcc_fallthrough (); evaluate: if (nested_forall_info != NULL) { diff --git gcc/gcc/gcc.c gcc/gcc/gcc.c index 7460f6a..becd304 100644 --- gcc/gcc/gcc.c +++ gcc/gcc/gcc.c @@ -3857,6 +3857,7 @@ driver_handle_option (struct gcc_options *opts, case OPT_fcompare_debug_: compare_debug_replacement_opt = decoded->canonical_option[0]; + gcc_fallthrough (); compare_debug_with_arg: gcc_assert (decoded->canonical_option_num_elements == 1); gcc_assert (arg != NULL); diff --git gcc/gcc/gcov-tool.c gcc/gcc/gcov-tool.c index f3da73c..28c9393 100644 --- gcc/gcc/gcov-tool.c +++ gcc/gcc/gcov-tool.c @@ -547,9 +547,11 @@ process_args (int argc, char **argv) case 'h': print_usage (false); /* Print_usage will exit. */ + gcc_fallthrough (); case 'v': print_version (); /* Print_version will exit. */ + gcc_fallthrough (); default: print_usage (true); /* Print_usage will exit. */ diff --git gcc/gcc/genattrtab.c gcc/gcc/genattrtab.c index d39d4a7..28795a6 100644 --- gcc/gcc/genattrtab.c +++ gcc/gcc/genattrtab.c @@ -888,6 +888,7 @@ check_attr_test (file_location loc, rtx exp, attr_desc *attr) ATTR_IND_SIMPLIFIED_P (exp) = 1; break; } + gcc_fallthrough (); default: fatal_at (loc, "invalid operator `%s' in definition of attribute" " `%s'", GET_RTX_NAME (GET_CODE (exp)), attr->name); @@ -1218,6 +1219,7 @@ make_canonical (file_location loc, struct attr_desc *attr, rtx exp) exp = newexp; /* Fall through to COND case since this is now a COND. */ + gcc_fallthrough (); case COND: { @@ -3458,6 +3460,7 @@ write_test_expr (FILE *outf, rtx exp, unsigned int attrs_cached, int flags, case GE: case GT: case LE: case LT: comparison_operator = FLG_BITWISE; + gcc_fallthrough (); case PLUS: case MINUS: case MULT: case DIV: case MOD: case AND: case IOR: case XOR: @@ -3613,6 +3616,7 @@ write_test_expr (FILE *outf, rtx exp, unsigned int attrs_cached, int flags, } /* Otherwise, fall through to normal unary operator. */ + gcc_fallthrough (); /* Unary operators. */ case ABS: case NEG: diff --git gcc/gcc/genconfig.c gcc/gcc/genconfig.c index 815e30d..ac65338 100644 --- gcc/gcc/genconfig.c +++ gcc/gcc/genconfig.c @@ -83,6 +83,8 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src) case MATCH_OP_DUP: case MATCH_PAR_DUP: ++dup_operands_seen_this_insn; + /* XXX Really fallthru? */ + gcc_fallthrough (); case MATCH_SCRATCH: case MATCH_PARALLEL: case MATCH_OPERATOR: diff --git gcc/gcc/gengtype.c gcc/gcc/gengtype.c index 5479b8f..0518355 100644 --- gcc/gcc/gengtype.c +++ gcc/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 gcc/gcc/genpreds.c gcc/gcc/genpreds.c index dd7dbbf..f2cedb5 100644 --- gcc/gcc/genpreds.c +++ gcc/gcc/genpreds.c @@ -51,12 +51,12 @@ validate_exp (rtx exp, const char *name, file_location loc) case IF_THEN_ELSE: if (validate_exp (XEXP (exp, 2), name, loc)) return true; - /* else fall through */ + /* fall through */ case AND: case IOR: if (validate_exp (XEXP (exp, 1), name, loc)) return true; - /* else fall through */ + /* fall through */ case NOT: return validate_exp (XEXP (exp, 0), name, loc); @@ -74,7 +74,7 @@ validate_exp (rtx exp, const char *name, file_location loc) } } } - /* fall through */ + gcc_fallthrough (); /* These need no special checking. */ case MATCH_OPERAND: @@ -174,12 +174,12 @@ needs_variable (rtx exp, const char *var) case IF_THEN_ELSE: if (needs_variable (XEXP (exp, 2), var)) return true; - /* else fall through */ + /* fall through */ case AND: case IOR: if (needs_variable (XEXP (exp, 1), var)) return true; - /* else fall through */ + /* fall through */ case NOT: return needs_variable (XEXP (exp, 0), var); 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) diff --git gcc/gcc/gimple-pretty-print.c gcc/gcc/gimple-pretty-print.c index 48edacc..7c12f84 100644 --- gcc/gcc/gimple-pretty-print.c +++ gcc/gcc/gimple-pretty-print.c @@ -517,8 +517,10 @@ dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc, int flags) { case 4: arg3 = gimple_assign_rhs3 (gs); + gcc_fallthrough (); case 3: arg2 = gimple_assign_rhs2 (gs); + gcc_fallthrough (); case 2: arg1 = gimple_assign_rhs1 (gs); break; diff --git gcc/gcc/gimple-ssa-strength-reduction.c gcc/gcc/gimple-ssa-strength-reduction.c index 6e277e7..0b759cd 100644 --- gcc/gcc/gimple-ssa-strength-reduction.c +++ gcc/gcc/gimple-ssa-strength-reduction.c @@ -1694,7 +1694,7 @@ find_candidates_dom_walker::before_dom_children (basic_block bb) case POINTER_PLUS_EXPR: case MINUS_EXPR: rhs2 = gimple_assign_rhs2 (gs); - /* Fall-through. */ + gcc_fallthrough (); CASE_CONVERT: case MODIFY_EXPR: diff --git gcc/gcc/gimplify.c gcc/gcc/gimplify.c index fb27dd0..0beb1ff 100644 --- gcc/gcc/gimplify.c +++ gcc/gcc/gimplify.c @@ -5190,7 +5553,7 @@ gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) if (integer_zerop (TREE_OPERAND (op0, 1))) goto do_indirect_ref; - /* ... fall through ... */ + /* fall through */ default: /* If we see a call to a declared builtin or see its address @@ -6155,6 +6518,7 @@ omp_default_clause (struct gimplify_omp_ctx *ctx, tree decl, flags |= GOVD_FIRSTPRIVATE; else flags |= GOVD_SHARED; + gcc_fallthrough (); found_outer: break; @@ -6941,6 +7305,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, case OACC_DATA: if (TREE_CODE (TREE_TYPE (decl)) != ARRAY_TYPE) break; + gcc_fallthrough (); case OMP_TARGET_DATA: case OMP_TARGET_ENTER_DATA: case OMP_TARGET_EXIT_DATA: @@ -7424,6 +7789,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, do_add: decl = OMP_CLAUSE_DECL (c); + gcc_fallthrough (); do_add_decl: if (error_operand_p (decl)) { @@ -7557,6 +7923,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, "copyprivate variable %qE is not threadprivate" " or private in outer context", DECL_NAME (decl)); } + gcc_fallthrough (); do_notice: if (outer_ctx) omp_notice_variable (outer_ctx, decl, true); @@ -9964,6 +10331,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); @@ -9978,6 +10347,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); diff --git gcc/gcc/go/go-system.h gcc/gcc/go/go-system.h index cb7e745..e1b6a70 100644 --- gcc/gcc/go/go-system.h +++ gcc/gcc/go/go-system.h @@ -138,4 +138,7 @@ struct hash<T*> // When using gcc, go_unreachable is just gcc_unreachable. #define go_unreachable() gcc_unreachable() +// When using gcc, go_fallthrough is just gcc_fallthrough. +#define go_fallthrough() gcc_fallthrough() + #endif // !defined(GO_SYSTEM_H) diff --git gcc/gcc/go/gofrontend/escape.cc gcc/gcc/go/gofrontend/escape.cc index af8f1e2..5b95d87 100644 --- gcc/gcc/go/gofrontend/escape.cc +++ gcc/gcc/go/gofrontend/escape.cc @@ -1484,6 +1484,7 @@ Escape_analysis_assign::assign(Node* dst, Node* src) if (!e->type()->has_pointer()) break; } + go_fallthrough (); case Expression::EXPRESSION_CONVERSION: case Expression::EXPRESSION_TYPE_GUARD: diff --git gcc/gcc/go/gofrontend/expressions.cc gcc/gcc/go/gofrontend/expressions.cc index 5f7e4c9..a13c997 100644 --- gcc/gcc/go/gofrontend/expressions.cc +++ gcc/gcc/go/gofrontend/expressions.cc @@ -5745,6 +5745,7 @@ Binary_expression::do_get_backend(Translate_context* context) case OPERATOR_DIV: if (left_type->float_type() != NULL || left_type->complex_type() != NULL) break; + go_fallthrough (); case OPERATOR_MOD: is_idiv_op = true; break; @@ -5754,6 +5755,7 @@ Binary_expression::do_get_backend(Translate_context* context) break; case OPERATOR_BITCLEAR: this->right_ = Expression::make_unary(OPERATOR_XOR, this->right_, loc); + go_fallthrough (); case OPERATOR_AND: break; default: diff --git gcc/gcc/godump.c gcc/gcc/godump.c index e3448a1..608542c 100644 --- gcc/gcc/godump.c +++ gcc/gcc/godump.c @@ -893,6 +893,7 @@ go_format_type (struct godump_container *container, tree type, case UNION_TYPE: is_union = true; /* Fall through to RECORD_TYPE case. */ + gcc_fallthrough (); case RECORD_TYPE: { unsigned int prev_field_end; diff --git gcc/gcc/graphite-isl-ast-to-gimple.c gcc/gcc/graphite-isl-ast-to-gimple.c index 07c88026..0eb564a 100644 --- gcc/gcc/graphite-isl-ast-to-gimple.c +++ gcc/gcc/graphite-isl-ast-to-gimple.c @@ -1496,7 +1496,7 @@ substitute_ssa_name (tree exp, tree f, tree r) if (exp == f) return r; - /* Fall through... */ + /* Fall through. */ case tcc_exceptional: case tcc_unary: diff --git gcc/gcc/hsa-gen.c gcc/gcc/hsa-gen.c index 6cf1538..b4498e2 100644 --- gcc/gcc/hsa-gen.c +++ gcc/gcc/hsa-gen.c @@ -4519,7 +4519,7 @@ get_address_from_value (tree val, hsa_bb *hbb) case INTEGER_CST: if (tree_fits_shwi_p (val)) return new hsa_op_address (NULL, NULL, tree_to_shwi (val)); - /* Otherwise fall-through */ + /* fall-through */ default: HSA_SORRY_ATV (EXPR_LOCATION (val), @@ -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/ipa-icf.c gcc/gcc/ipa-icf.c index 3c04b5a..f29d929 100644 --- gcc/gcc/ipa-icf.c +++ gcc/gcc/ipa-icf.c @@ -1643,7 +1643,7 @@ sem_function::hash_stmt (gimple *stmt, inchash::hash &hstate) add_type (TREE_TYPE (gimple_assign_lhs (stmt)), two); break; } - /* ... fall through ... */ + /* fall through */ case GIMPLE_CALL: case GIMPLE_ASM: case GIMPLE_COND: diff --git gcc/gcc/ira.c gcc/gcc/ira.c index c66bb9e..f6eb7ca 100644 --- gcc/gcc/ira.c +++ gcc/gcc/ira.c @@ -1832,6 +1832,7 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts) case '#': case ',': c = '\0'; + gcc_fallthrough (); case '\0': len = 0; break; diff --git gcc/gcc/java/expr.c gcc/gcc/java/expr.c index 2b856e5..ca58d28 100644 --- gcc/gcc/java/expr.c +++ gcc/gcc/java/expr.c @@ -191,7 +191,7 @@ java_truthvalue_conversion (tree expr) if (TYPE_PRECISION (TREE_TYPE (expr)) >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))) return java_truthvalue_conversion (TREE_OPERAND (expr, 0)); - /* fall through to default */ + /* fall through */ default: return fold_build2 (NE_EXPR, boolean_type_node, diff --git gcc/gcc/java/jcf-dump.c gcc/gcc/java/jcf-dump.c index 1331b55..8b00e57 100644 --- gcc/gcc/java/jcf-dump.c +++ gcc/gcc/java/jcf-dump.c @@ -926,6 +926,7 @@ print_constant (FILE *out, JCF *jcf, int index, int verbosity) if (verbosity > 0) fprintf (out, "Fieldref: %ld=", (long) JPOOL_USHORT2 (jcf, index)); print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0); + break; case 5: case 6: case 7: diff --git gcc/gcc/java/jcf-io.c gcc/gcc/java/jcf-io.c index a560db7..cc8616b 100644 --- gcc/gcc/java/jcf-io.c +++ gcc/gcc/java/jcf-io.c @@ -471,7 +471,7 @@ verify_constant_pool (JCF *jcf) if (n <= 0 || n >= JPOOL_SIZE(jcf) || JPOOL_TAG (jcf, n) != CONSTANT_Utf8) return i; - /* ... fall through ... */ + /* fall through */ case CONSTANT_Class: case CONSTANT_String: n = JPOOL_USHORT1 (jcf, i); diff --git gcc/gcc/java/typeck.c gcc/gcc/java/typeck.c index d2e3db6..8e52daf 100644 --- gcc/gcc/java/typeck.c +++ gcc/gcc/java/typeck.c @@ -332,6 +332,7 @@ promote_type (tree type) case INTEGER_TYPE: if (type == char_type_node) return promoted_char_type_node; + gcc_fallthrough (); handle_int: if (TYPE_PRECISION (type) < TYPE_PRECISION (int_type_node)) { @@ -341,7 +342,7 @@ promote_type (tree type) return promoted_byte_type_node; return int_type_node; } - /* ... else fall through ... */ + /* fall through */ default: return type; } diff --git gcc/gcc/lra-eliminations.c gcc/gcc/lra-eliminations.c index 9ae5cfe..08cc390 100644 --- gcc/gcc/lra-eliminations.c +++ gcc/gcc/lra-eliminations.c @@ -484,7 +484,7 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode, return gen_rtx_MULT (Pmode, to, XEXP (x, 1)); } - /* ... fall through ... */ + /* fall through */ case CALL: case COMPARE: @@ -536,7 +536,7 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode, } } - /* ... fall through ... */ + /* fall through */ case INSN_LIST: case INT_LIST: diff --git gcc/gcc/lto-streamer-out.c gcc/gcc/lto-streamer-out.c index e243337..572b53b 100644 --- gcc/gcc/lto-streamer-out.c +++ gcc/gcc/lto-streamer-out.c @@ -231,6 +231,7 @@ lto_output_tree_ref (struct output_block *ob, tree expr) case VAR_DECL: case DEBUG_EXPR_DECL: gcc_assert (decl_function_context (expr) == NULL || TREE_STATIC (expr)); + gcc_fallthrough (); case PARM_DECL: streamer_write_record_start (ob, LTO_global_decl_ref); lto_output_var_decl_index (ob->decl_state, ob->main_stream, expr); diff --git gcc/gcc/objc/objc-encoding.c gcc/gcc/objc/objc-encoding.c index 41ac6a4..cc64e1b 100644 --- gcc/gcc/objc/objc-encoding.c +++ gcc/gcc/objc/objc-encoding.c @@ -622,6 +622,7 @@ encode_type (tree type, int curtype, int format) } /* Else, they are encoded exactly like the integer type that is used by the compiler to store them. */ + gcc_fallthrough (); case INTEGER_TYPE: { char c; diff --git gcc/gcc/omp-low.c gcc/gcc/omp-low.c index 04509f3..0490d55 100644 --- gcc/gcc/omp-low.c +++ gcc/gcc/omp-low.c @@ -1949,6 +1949,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx, case OMP_CLAUSE_FIRSTPRIVATE: case OMP_CLAUSE_LINEAR: decl = OMP_CLAUSE_DECL (c); + gcc_fallthrough (); do_private: if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_IS_DEVICE_PTR) @@ -4432,6 +4433,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, || is_global_var (OMP_CLAUSE_DECL (c))); continue; } + gcc_fallthrough (); case OMP_CLAUSE_FIRSTPRIVATE: case OMP_CLAUSE_COPYIN: break; @@ -4943,6 +4945,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, } else x = NULL; + gcc_fallthrough (); do_private: tree nx; nx = lang_hooks.decls.omp_clause_default_ctor @@ -5015,6 +5018,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, goto do_dtor; } } + gcc_fallthrough (); do_firstprivate: x = build_outer_var_ref (var, ctx); if (is_simd) diff --git gcc/gcc/opts.c gcc/gcc/opts.c index 4053fb1..f6da14e 100644 --- gcc/gcc/opts.c +++ gcc/gcc/opts.c @@ -1980,6 +1980,7 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_profile_use = true; value = true; /* No break here - do -fprofile-use processing. */ + gcc_fallthrough (); case OPT_fprofile_use: enable_fdo_optimizations (opts, opts_set, value); if (!opts_set->x_flag_profile_reorder_functions) @@ -1996,6 +1997,7 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_auto_profile = true; value = true; /* No break here - do -fauto-profile processing. */ + gcc_fallthrough (); case OPT_fauto_profile: enable_fdo_optimizations (opts, opts_set, value); if (!opts_set->x_flag_profile_correction) @@ -2009,6 +2011,7 @@ common_handle_option (struct gcc_options *opts, opts->x_profile_data_prefix = xstrdup (arg); value = true; /* No break here - do -fprofile-generate processing. */ + gcc_fallthrough (); case OPT_fprofile_generate: if (!opts_set->x_profile_arc_flag) opts->x_profile_arc_flag = value; diff --git gcc/gcc/print-rtl.c gcc/gcc/print-rtl.c index a905127..b9d7cf4 100644 --- gcc/gcc/print-rtl.c +++ gcc/gcc/print-rtl.c @@ -217,6 +217,7 @@ print_rtx (const_rtx in_rtx) case 'S': case 's': str = XSTR (in_rtx, i); + gcc_fallthrough (); string: if (str == 0) diff --git gcc/gcc/read-rtl.c gcc/gcc/read-rtl.c index a705859..b8880b9 100644 --- gcc/gcc/read-rtl.c +++ gcc/gcc/read-rtl.c @@ -1163,6 +1163,7 @@ read_rtx_code (const char *code_name) break; } /* Now process the vector. */ + gcc_fallthrough (); case 'E': { diff --git gcc/gcc/real.c gcc/gcc/real.c index b009ed6..b472b05 100644 --- gcc/gcc/real.c +++ gcc/gcc/real.c @@ -2667,6 +2667,7 @@ round_for_format (const struct real_format *fmt, REAL_VALUE_TYPE *r) { underflow: get_zero (r, r->sign); + gcc_fallthrough (); case rvc_zero: if (!fmt->has_signed_zero) r->sign = 0; @@ -2674,6 +2675,7 @@ round_for_format (const struct real_format *fmt, REAL_VALUE_TYPE *r) overflow: get_inf (r, r->sign); + gcc_fallthrough (); case rvc_inf: return; diff --git gcc/gcc/recog.c gcc/gcc/recog.c index 80d1779..f400a6e 100644 --- gcc/gcc/recog.c +++ gcc/gcc/recog.c @@ -1792,6 +1792,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints) Match any memory and hope things are resolved after reload. */ incdec_ok = true; + gcc_fallthrough (); default: cn = lookup_constraint (constraint); switch (get_constraint_type (cn)) 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/reginfo.c gcc/gcc/reginfo.c index f4dac08..0cda6aa 100644 --- gcc/gcc/reginfo.c +++ gcc/gcc/reginfo.c @@ -1149,7 +1149,7 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn) if (REG_P (dest) && !REG_ATTRS (dest)) set_reg_attrs_from_value (dest, SET_SRC (x)); - /* ... fall through ... */ + /* fall through */ default: { diff --git gcc/gcc/reload1.c gcc/gcc/reload1.c index 5622e89..8318b8a 100644 --- gcc/gcc/reload1.c +++ gcc/gcc/reload1.c @@ -2330,7 +2330,7 @@ set_label_offsets (rtx x, rtx_insn *insn, int initial_p) x = LABEL_REF_LABEL (x); - /* ... fall through ... */ + /* fall through */ case CODE_LABEL: /* If we know nothing about this label, set the desired offsets. Note @@ -2377,7 +2377,7 @@ set_label_offsets (rtx x, rtx_insn *insn, int initial_p) case JUMP_INSN: set_label_offsets (PATTERN (insn), insn, initial_p); - /* ... fall through ... */ + /* fall through */ case INSN: case CALL_INSN: @@ -2692,7 +2692,7 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn, ep->previous_offset * INTVAL (XEXP (x, 1))); } - /* ... fall through ... */ + /* fall through */ case CALL: case COMPARE: @@ -2739,7 +2739,7 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn, } } - /* ... fall through ... */ + /* fall through */ case INSN_LIST: case INT_LIST: @@ -3032,6 +3032,7 @@ elimination_effects (rtx x, machine_mode mem_mode) break; /* Fall through to generic unary operation case. */ + gcc_fallthrough (); case STRICT_LOW_PART: case NEG: case NOT: case SIGN_EXTEND: case ZERO_EXTEND: @@ -5501,7 +5502,7 @@ reload_reg_reaches_end_p (unsigned int regno, int reloadnum) opnum = reload_n_operands; - /* ... fall through ... */ + /* fall through */ case RELOAD_FOR_OUTPUT: case RELOAD_FOR_OUTPUT_ADDRESS: diff --git gcc/gcc/resource.c gcc/gcc/resource.c index ae2f5d8..6e58b3b 100644 --- gcc/gcc/resource.c +++ gcc/gcc/resource.c @@ -364,6 +364,7 @@ mark_referenced_resources (rtx x, struct resources *res, } /* ... fall through to other INSN processing ... */ + gcc_fallthrough (); case INSN: case JUMP_INSN: @@ -674,6 +675,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest, } /* ... and also what its RTL says it modifies, if anything. */ + gcc_fallthrough (); case JUMP_INSN: case INSN: diff --git gcc/gcc/rtlanal.c gcc/gcc/rtlanal.c index 9445329..74eee1f 100644 --- gcc/gcc/rtlanal.c +++ gcc/gcc/rtlanal.c @@ -1765,6 +1765,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in) case REG: regno = REGNO (x); endregno = END_REGNO (x); + gcc_fallthrough (); do_reg: return refers_to_regno_p (regno, endregno, in, (rtx*) 0); @@ -3421,6 +3422,7 @@ commutative_operand_precedence (rtx op) /* Then prefer NEG and NOT. */ if (code == NEG || code == NOT) return 1; + gcc_fallthrough (); default: return 0; @@ -4095,7 +4097,7 @@ rtx_cost (rtx x, machine_mode mode, enum rtx_code outer_code, factor = GET_MODE_SIZE (mode) / UNITS_PER_WORD; if (factor == 0) factor = 1; - /* Pass through. */ + gcc_fallthrough (); default: total = factor * COSTS_N_INSNS (1); } diff --git gcc/gcc/sched-rgn.c gcc/gcc/sched-rgn.c index fa662ff..03c0e13 100644 --- gcc/gcc/sched-rgn.c +++ gcc/gcc/sched-rgn.c @@ -2052,6 +2052,7 @@ is_exception_free (rtx_insn *insn, int bb_src, int bb_trg) if (is_pfree (insn, bb_src, bb_trg)) return 1; /* Don't 'break' here: PFREE-candidate is also PRISKY-candidate. */ + gcc_fallthrough (); case PRISKY_CANDIDATE: if (!flag_schedule_speculative_load_dangerous || is_prisky (insn, bb_src, bb_trg)) diff --git gcc/gcc/simplify-rtx.c gcc/gcc/simplify-rtx.c index c34f2f5..df770da1 100644 --- gcc/gcc/simplify-rtx.c +++ gcc/gcc/simplify-rtx.c @@ -3308,6 +3308,7 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, tmp); return lowpart_subreg (mode, tmp, inner_mode); } + gcc_fallthrough (); canonicalize_shift: if (SHIFT_COUNT_TRUNCATED && CONST_INT_P (op1)) { @@ -6253,7 +6254,7 @@ simplify_rtx (const_rtx x) if (swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1))) return simplify_gen_binary (code, mode, XEXP (x, 1), XEXP (x, 0)); - /* Fall through.... */ + /* Fall through. */ case RTX_BIN_ARITH: return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1)); diff --git gcc/gcc/stor-layout.c gcc/gcc/stor-layout.c index 4ada959..78a5f04 100644 --- gcc/gcc/stor-layout.c +++ gcc/gcc/stor-layout.c @@ -398,7 +398,7 @@ int_mode_for_mode (machine_mode mode) if (mode == BLKmode) break; - /* ... fall through ... */ + /* fall through */ case MODE_CC: default: diff --git gcc/gcc/toplev.c gcc/gcc/toplev.c index b0bb3ec..d593b92 100644 --- gcc/gcc/toplev.c +++ gcc/gcc/toplev.c @@ -731,7 +731,7 @@ print_to_asm_out_file (print_switch_type type, const char * text) case SWITCH_TYPE_DESCRIPTIVE: if (ASM_COMMENT_START[0] == 0) prepend_sep = false; - /* Drop through. */ + gcc_fallthrough (); case SWITCH_TYPE_PASSED: case SWITCH_TYPE_ENABLED: if (prepend_sep) @@ -761,7 +761,7 @@ print_to_stderr (print_switch_type type, const char * text) case SWITCH_TYPE_PASSED: case SWITCH_TYPE_ENABLED: fputc (' ', stderr); - /* Drop through. */ + gcc_fallthrough (); case SWITCH_TYPE_DESCRIPTIVE: fputs (text, stderr); diff --git gcc/gcc/tree-cfg.c gcc/gcc/tree-cfg.c index 0728020..4036223 100644 --- gcc/gcc/tree-cfg.c +++ gcc/gcc/tree-cfg.c @@ -5412,7 +5412,7 @@ gimple_verify_flow_info (void) case GIMPLE_CALL: if (!gimple_call_builtin_p (stmt, BUILT_IN_RETURN)) break; - /* ... fallthru ... */ + /* fallthru */ case GIMPLE_RETURN: if (!single_succ_p (bb) || (single_succ_edge (bb)->flags diff --git gcc/gcc/tree-chrec.c gcc/gcc/tree-chrec.c index ee789a2..4507bf6 100644 --- gcc/gcc/tree-chrec.c +++ gcc/gcc/tree-chrec.c @@ -287,6 +287,7 @@ chrec_fold_plus_1 (enum tree_code code, tree type, CASE_CONVERT: if (tree_contains_chrecs (op1, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: if (code == PLUS_EXPR || code == POINTER_PLUS_EXPR) @@ -304,6 +305,7 @@ chrec_fold_plus_1 (enum tree_code code, tree type, CASE_CONVERT: if (tree_contains_chrecs (op0, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: switch (TREE_CODE (op1)) @@ -423,6 +425,7 @@ chrec_fold_multiply (tree type, CASE_CONVERT: if (tree_contains_chrecs (op1, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: if (integer_onep (op1)) @@ -439,6 +442,7 @@ chrec_fold_multiply (tree type, CASE_CONVERT: if (tree_contains_chrecs (op0, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: if (integer_onep (op0)) @@ -461,6 +465,7 @@ chrec_fold_multiply (tree type, CASE_CONVERT: if (tree_contains_chrecs (op1, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: if (integer_onep (op1)) @@ -1026,6 +1031,7 @@ evolution_function_is_invariant_rec_p (tree chrec, int loopnum) if (!evolution_function_is_invariant_rec_p (TREE_OPERAND (chrec, 1), loopnum)) return false; + gcc_fallthrough (); case 1: if (!evolution_function_is_invariant_rec_p (TREE_OPERAND (chrec, 0), @@ -1527,12 +1533,15 @@ for_each_scev_op (tree *scev, bool (*cbck) (tree *, void *), void *data) { case 3: for_each_scev_op (&TREE_OPERAND (*scev, 2), cbck, data); + gcc_fallthrough (); case 2: for_each_scev_op (&TREE_OPERAND (*scev, 1), cbck, data); + gcc_fallthrough (); case 1: for_each_scev_op (&TREE_OPERAND (*scev, 0), cbck, data); + gcc_fallthrough (); default: cbck (scev, data); 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): diff --git gcc/gcc/tree-data-ref.c gcc/gcc/tree-data-ref.c index 081ee603..8b86f87 100644 --- gcc/gcc/tree-data-ref.c +++ gcc/gcc/tree-data-ref.c @@ -1685,6 +1685,7 @@ siv_subscript_p (const_tree chrec_a, const_tree chrec_b) case POLYNOMIAL_CHREC: if (CHREC_VARIABLE (chrec_a) != CHREC_VARIABLE (chrec_b)) return false; + gcc_fallthrough (); default: return true; @@ -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)); diff --git gcc/gcc/tree-pretty-print.c gcc/gcc/tree-pretty-print.c index 734ecda..74cd9da 100644 --- gcc/gcc/tree-pretty-print.c +++ gcc/gcc/tree-pretty-print.c @@ -743,6 +743,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags) pp_colon (pp); dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); + gcc_fallthrough (); print_clause_size: if (OMP_CLAUSE_SIZE (clause)) { @@ -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)) diff --git gcc/gcc/tree-ssa-loop-ivopts.c gcc/gcc/tree-ssa-loop-ivopts.c index 62ba71b..1f9eb8a 100644 --- gcc/gcc/tree-ssa-loop-ivopts.c +++ gcc/gcc/tree-ssa-loop-ivopts.c @@ -1885,8 +1885,8 @@ find_deriving_biv_for_expr (struct ivopts_data *data, tree expr) iv = find_deriving_biv_for_expr (data, e2); if (iv) return iv; + gcc_fallthrough (); - /* Fallthru. */ CASE_CONVERT: /* Casts are simple. */ return find_deriving_biv_for_expr (data, e1); diff --git gcc/gcc/tree-vect-patterns.c gcc/gcc/tree-vect-patterns.c index 2457844..a95e8d9 100644 --- gcc/gcc/tree-vect-patterns.c +++ gcc/gcc/tree-vect-patterns.c @@ -3358,6 +3358,7 @@ adjust_bool_pattern (tree var, tree out_type, case BIT_XOR_EXPR: irhs1 = *defs.get (rhs1); irhs2 = *defs.get (rhs2); + gcc_fallthrough (); and_ior_xor: if (TYPE_PRECISION (TREE_TYPE (irhs1)) != TYPE_PRECISION (TREE_TYPE (irhs2))) diff --git gcc/gcc/tree-chrec.c gcc/gcc/tree-chrec.c index 707a3aa..09ba618 100644 --- gcc/gcc/tree-chrec.c +++ gcc/gcc/tree-chrec.c @@ -329,6 +329,7 @@ chrec_fold_plus_1 (enum tree_code code, tree type, CASE_CONVERT: if (tree_contains_chrecs (op1, NULL)) return chrec_dont_know; + gcc_fallthrough (); default: { diff --git gcc/gcc/tree-eh.c gcc/gcc/tree-eh.c index db72156..3cc7899 100644 --- gcc/gcc/tree-eh.c +++ gcc/gcc/tree-eh.c @@ -2011,6 +2011,7 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi) is accessible to abuse by users. Just remove it and replace the use with the arbitrary value zero. */ rhs = build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), 0); + gcc_fallthrough (); do_replace: lhs = gimple_call_lhs (stmt); x = gimple_build_assign (lhs, rhs); diff --git gcc/gcc/tree.c gcc/gcc/tree.c index 661d385..72c8696 100644 --- gcc/gcc/tree.c +++ gcc/gcc/tree.c @@ -3727,7 +3727,7 @@ find_placeholder_in_expr (tree exp, vec<tree> *refs) break; } - /* Fall through... */ + /* Fall through. */ case tcc_exceptional: case tcc_unary: @@ -3816,7 +3816,7 @@ substitute_in_expr (tree exp, tree f, tree r) if (exp == f) return r; - /* Fall through... */ + /* Fall through. */ case tcc_exceptional: case tcc_unary: @@ -7027,7 +7027,7 @@ type_cache_hasher::equal (type_hash *a, type_hash *b) TYPE_VALUES (b->type)))) return 0; - /* ... fall through ... */ + /* fall through */ case INTEGER_TYPE: case REAL_TYPE: @@ -11564,7 +11564,7 @@ walk_type_fields (tree type, walk_tree_fn func, void *data, break; } - /* ... fall through ... */ + /* fall through */ case COMPLEX_TYPE: WALK_SUBTREE (TREE_TYPE (type)); diff --git gcc/gcc/var-tracking.c gcc/gcc/var-tracking.c index 5d09879..d01af62 100644 --- 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); @@ -1112,6 +1116,7 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) SUBREG_BYTE (loc)); if (tem == NULL_RTX) tem = gen_rtx_raw_SUBREG (GET_MODE (loc), addr, SUBREG_BYTE (loc)); + gcc_fallthrough (); finish_subreg: if (MAY_HAVE_DEBUG_INSNS && GET_CODE (tem) == SUBREG @@ -3148,7 +3153,7 @@ set_dv_changed (decl_or_value dv, bool newv) case ONEPART_DEXPR: if (newv) NO_LOC_P (DECL_RTL_KNOWN_SET (dv_as_decl (dv))) = false; - /* Fall through... */ + /* Fall through. */ default: DECL_CHANGED (dv_as_decl (dv)) = newv; diff --git gcc/gcc/varasm.c gcc/gcc/varasm.c index 4ef6115..f656d81 100644 --- gcc/gcc/varasm.c +++ gcc/gcc/varasm.c @@ -589,6 +589,7 @@ default_function_section (tree decl, enum node_frequency freq, these ELF section. */ if (!in_lto_p || !flag_profile_values) return get_named_text_section (decl, ".text.hot", NULL); + gcc_fallthrough (); default: return NULL; } @@ -3568,6 +3569,7 @@ const_rtx_hash_1 (const_rtx x) { case CONST_INT: hwi = INTVAL (x); + gcc_fallthrough (); fold_hwi: { @@ -4172,7 +4174,7 @@ output_addressed_constants (tree exp) case POINTER_PLUS_EXPR: case MINUS_EXPR: output_addressed_constants (TREE_OPERAND (exp, 1)); - /* Fall through. */ + gcc_fallthrough (); CASE_CONVERT: case VIEW_CONVERT_EXPR: diff --git gcc/include/libiberty.h gcc/include/libiberty.h index a9c885f..89a9e6d 100644 --- gcc/include/libiberty.h +++ gcc/include/libiberty.h @@ -735,5 +735,10 @@ extern unsigned long libiberty_len; } #endif +#if GCC_VERSION >= 7000 +# define D_FALLTHRU() __attribute__((fallthrough)) +#else +# define D_FALLTHRU() +#endif #endif /* ! defined (LIBIBERTY_H) */ diff --git gcc/libcpp/internal.h gcc/libcpp/internal.h index ca2b498..de9cc25 100644 --- gcc/libcpp/internal.h +++ gcc/libcpp/internal.h @@ -78,6 +78,12 @@ struct cset_converter efficiency, and partly to limit runaway recursion. */ #define CPP_STACK_MAX 200 +#if __GNUC__ >= 7 +# define CPP_FALLTHRU __attribute__((fallthrough)) +#else +# define CPP_FALLTHRU +#endif + /* Host alignment handling. */ struct dummy { diff --git gcc/libcpp/lex.c gcc/libcpp/lex.c index 236418d..e5184df 100644 --- gcc/libcpp/lex.c +++ gcc/libcpp/lex.c @@ -610,6 +610,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) if (l != 0) break; s += sizeof(unsigned long); + CPP_FALLTHRU; case 2: l = u.l[i++]; if (l != 0) @@ -1574,6 +1575,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, BUF_APPEND (base, cur - base); base = cur; BUF_APPEND ("\\", 1); + CPP_FALLTHRU; after_backslash: if (note->type == ' ') { @@ -2717,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); @@ -3322,7 +3424,7 @@ cpp_token_val_index (const cpp_token *tok) return CPP_TOKEN_FLD_SOURCE; else if (tok->type == CPP_PRAGMA) return CPP_TOKEN_FLD_PRAGMA; - /* else fall through */ + /* fall through */ default: return CPP_TOKEN_FLD_NONE; } diff --git gcc/libcpp/macro.c gcc/libcpp/macro.c index a3b8348..d71e2cd 100644 --- gcc/libcpp/macro.c +++ gcc/libcpp/macro.c @@ -2886,6 +2886,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) return true; /* Fall through to pick up the error. */ + CPP_FALLTHRU; case CPP_COMMA: if (!prev_ident) { diff --git gcc/libcpp/pch.c gcc/libcpp/pch.c index aa5ed6b..09f36d9 100644 --- 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) @@ -230,7 +232,7 @@ count_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p) if (hn->flags & NODE_BUILTIN) return 1; - /* else fall through. */ + /* fall through. */ case NT_VOID: { @@ -269,7 +271,7 @@ write_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p) if (hn->flags & NODE_BUILTIN) return 1; - /* else fall through. */ + /* fall through. */ case NT_VOID: { diff --git gcc/libgcc/soft-fp/op-common.h gcc/libgcc/soft-fp/op-common.h index 080ef0e..d3cb206 100644 --- gcc/libgcc/soft-fp/op-common.h +++ gcc/libgcc/soft-fp/op-common.h @@ -898,6 +898,7 @@ case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF): \ case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO): \ R##_s = X##_s; \ + _FP_FALLTHRU; \ \ case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF): \ case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL): \ @@ -911,6 +912,7 @@ case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN): \ case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN): \ R##_s = Y##_s; \ + _FP_FALLTHRU; \ \ case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF): \ case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO): \ @@ -1198,6 +1200,7 @@ \ case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO): \ FP_SET_EXCEPTION (FP_EX_DIVZERO); \ + _FP_FALLTHRU; \ case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO): \ case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL): \ R##_c = FP_CLS_INF; \ diff --git gcc/libgcc/soft-fp/soft-fp.h gcc/libgcc/soft-fp/soft-fp.h index 3b39336..ee03fa2 100644 --- gcc/libgcc/soft-fp/soft-fp.h +++ gcc/libgcc/soft-fp/soft-fp.h @@ -71,6 +71,12 @@ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif +#if (defined __GNUC__ && __GNUC__ >= 7) +# define _FP_FALLTHRU __attribute__((fallthrough)) +#else +# define _FP_FALLTHRU +#endif + /* In the Linux kernel, some architectures have a single function that uses different kinds of unpacking and packing depending on the instruction being emulated, meaning it is not readily visible to diff --git gcc/libgo/runtime/heapdump.c gcc/libgo/runtime/heapdump.c index d0cfb01..1ce8aa2 100644 --- gcc/libgo/runtime/heapdump.c +++ gcc/libgo/runtime/heapdump.c @@ -766,6 +766,7 @@ dumpefacetypes(void *obj __attribute__ ((unused)), uintptr size, const Type *typ for(i = 0; i <= size - type->__size; i += type->__size) //playgcprog(i, (uintptr*)type->gc + 1, dumpeface_callback, obj); break; + break; case TypeInfo_Chan: if(type->__size == 0) // channels may have zero-sized objects in them break; diff --git gcc/libiberty/cp-demangle.c gcc/libiberty/cp-demangle.c index 0c6d714..9ad787a 100644 --- gcc/libiberty/cp-demangle.c +++ gcc/libiberty/cp-demangle.c @@ -5777,11 +5777,13 @@ d_print_mod (struct d_print_info *dpi, int options, case DEMANGLE_COMPONENT_REFERENCE_THIS: /* For the ref-qualifier, put a space before the &. */ d_append_char (dpi, ' '); + D_FALLTHRU (); case DEMANGLE_COMPONENT_REFERENCE: d_append_char (dpi, '&'); return; case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS: d_append_char (dpi, ' '); + D_FALLTHRU (); case DEMANGLE_COMPONENT_RVALUE_REFERENCE: d_append_string (dpi, "&&"); return; diff --git gcc/libstdc++-v3/libsupc++/hash_bytes.cc gcc/libstdc++-v3/libsupc++/hash_bytes.cc index 2e5bbfa..1042de6 100644 --- gcc/libstdc++-v3/libsupc++/hash_bytes.cc +++ gcc/libstdc++-v3/libsupc++/hash_bytes.cc @@ -95,8 +95,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { case 3: hash ^= static_cast<unsigned char>(buf[2]) << 16; + [[gnu::fallthrough]]; case 2: hash ^= static_cast<unsigned char>(buf[1]) << 8; + [[gnu::fallthrough]]; case 1: hash ^= static_cast<unsigned char>(buf[0]); hash *= m; Marek