2016-07-11  Marek Polacek  <pola...@redhat.com>

        PR c/7652
        * call.c (add_builtin_candidate): Add gcc_fallthrough.
        (add_builtin_candidates): Likewise.
        (build_integral_nontype_arg_conv): Likewise.
        (build_new_op_1): Likewise.
        (convert_like_real): Likewise.
        * cfns.h (libc_name::hash): Likewise.
        * class.c (fixed_type_or_null): Likewise.
        (instantiate_type): Likewise.
        * constexpr.c (cxx_eval_constant_expression): Likewise.
        (potential_constant_expression_1): Likewise.
        * cp-gimplify.c (cp_gimplify_expr): Likewise.
        (cp_genericize_r): Likewise.
        (cp_fold): Likewise.
        * cp-ubsan.c (cp_ubsan_check_member_access_r): Likewise.
        * cvt.c (build_expr_type_conversion): Likewise.
        * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
        (pp_cxx_qualified_id): Likewise.
        (cxx_pretty_printer::constant): Likewise.
        (cxx_pretty_printer::primary_expression): Likewise.
        (cxx_pretty_printer::unary_expression): Likewise.
        (pp_cxx_pm_expression): Likewise.
        (cxx_pretty_printer::expression): Likewise.
        (cxx_pretty_printer::function_specifier): Likewise.
        (cxx_pretty_printer::declaration_specifiers): Likewise.
        (pp_cxx_type_specifier_seq): Likewise.
        (pp_cxx_ptr_operator): Likewise.
        * decl.c (grokdeclarator): Likewise.
        * decl2.c (coerce_new_type): Likewise.
        (coerce_delete_type): Likewise.
        * dump.c (cp_dump_tree): Likewise.
        * error.c (dump_type): Likewise.
        (dump_type_prefix): Likewise.
        (dump_type_suffix): Likewise.
        (dump_decl): Likewise.
        (dump_expr): Likewise.
        * expr.c (cplus_expand_constant): Likewise.
        * mangle.c (write_type): Likewise.
        (write_expression): Likewise.
        * method.c (synthesized_method_walk): Likewise.
        * name-lookup.c (begin_scope): Likewise.
        (arg_assoc_type): Likewise.
        * parser.c (cp_lexer_print_token): Likewise.
        (cp_parser_skip_to_end_of_statement): Likewise.
        (cp_parser_primary_expression): Likewise.
        (cp_parser_id_expression): Likewise.
        (cp_parser_unqualified_id): Likewise.
        (cp_parser_unary_expression): Likewise.
        (cp_parser_builtin_offsetof): Likewise.
        (cp_parser_jump_statement): Likewise.
        (cp_parser_storage_class_specifier_opt): Likewise.
        (cp_parser_operator): Likewise.
        (cp_parser_type_specifier): Likewise.
        (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
        (cp_parser_cache_defarg): Likewise.
        (cp_parser_objc_declaration): Likewise.
        (cp_parser_omp_var_list_no_open): Likewise.
        (cp_parser_omp_atomic): Likewise.
        (cp_parser_omp_for_cond): Likewise.
        * pt.c (check_explicit_specialization): Likewise.
        (find_parameter_packs_r): Likewise.
        (coerce_template_template_parm): Likewise.
        (for_each_template_parm_r): Likewise.
        (tsubst_aggr_type): Likewise.
        (tsubst_copy): Likewise.
        (tsubst_omp_clauses): Likewise.
        (tsubst_omp_for_iterator): Likewise.
        (tsubst_expr): Likewise.
        (tsubst_copy_and_build): Likewise.
        (unify): Likewise.
        (value_dependent_expression_p): Likewise.
        * rtti.c (build_dynamic_cast_1): Likewise.
        (involves_incomplete_p): Likewise.
        * gcc/cp/semantics.c (finish_omp_clauses): Likewise.
        (finish_decltype_type): Likewise.
        * tree.c (lvalue_kind): Likewise.
        (strip_typedefs_expr): Likewise.
        (no_linkage_check): Likewise.
        (bot_manip): Likewise.
        * typeck.c (structural_comptypes): Likewise.
        (is_bitfield_expr_with_lowered_type): Likewise.
        (cp_build_binary_op): Likewise.
        (cp_build_addr_expr_1): Likewise.
        (cxx_mark_addressable): Likewise.
        (cp_build_modify_expr): Likewise.
        * typeck2.c (split_nonconstant_init_1): Likewise.

diff --git gcc/gcc/cp/call.c gcc/gcc/cp/call.c
index d77092b..4e8d89b 100644
--- gcc/gcc/cp/call.c
+++ gcc/gcc/cp/call.c
@@ -2418,6 +2418,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))
@@ -2454,6 +2455,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;
@@ -2539,6 +2541,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))
@@ -2561,6 +2565,7 @@ add_builtin_candidate (struct z_candidate **candidates, 
enum tree_code code,
          break;
        }
       /* Fall through.  */
+      gcc_fallthrough ();
     case LT_EXPR:
     case GT_EXPR:
     case LE_EXPR:
@@ -2591,6 +2596,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))
        {
@@ -2671,6 +2677,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))
@@ -2899,6 +2907,8 @@ add_builtin_candidates (struct z_candidate **candidates, 
enum tree_code code,
     case GE_EXPR:
       enum_p = 1;
       /* Fall through.  */
+      gcc_fallthrough ();
+
 
     default:
       ref1 = 0;
@@ -3952,6 +3962,7 @@ build_integral_nontype_arg_conv (tree type, tree expr, 
tsubst_flags_t complain)
          error_at (loc, "conversion from %qT to %qT not considered for "
                    "non-type template argument", t, type);
        /* and fall through.  */
+       gcc_fallthrough ();
 
       default:
        conv = NULL;
@@ -5477,6 +5488,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;
@@ -5821,6 +5833,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int 
flags, tree arg1,
                               code_orig_arg1, arg1,
                               code_orig_arg2, arg2);
       /* Fall through.  */
+      gcc_fallthrough ();
     case GT_EXPR:
     case LT_EXPR:
     case GE_EXPR:
@@ -5834,6 +5847,7 @@ build_new_op_1 (location_t loc, enum tree_code code, int 
flags, tree arg1,
       if (complain & tf_warning && warn_tautological_compare)
        warn_tautological_cmp (loc, code, arg1, arg2);
       /* Fall through.  */
+      gcc_fallthrough ();
     case PLUS_EXPR:
     case MINUS_EXPR:
     case MULT_EXPR:
@@ -6646,6 +6660,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, 
int argnum,
       if (! MAYBE_CLASS_TYPE_P (totype))
        return expr;
       /* Else fall through.  */
+      gcc_fallthrough ();
     case ck_base:
       if (convs->kind == ck_base && !convs->need_temporary_p)
        {
diff --git gcc/gcc/cp/cfns.h gcc/gcc/cp/cfns.h
index 9a37249..50241ca 100644
--- gcc/gcc/cp/cfns.h
+++ gcc/gcc/cp/cfns.h
@@ -96,18 +96,23 @@ libc_name::hash (register const char *str, register 
unsigned int len)
       default:
         hval += asso_values[(unsigned char)str[5]+1];
       /*FALLTHROUGH*/
+      gcc_fallthrough ();
       case 5:
         hval += asso_values[(unsigned char)str[4]];
       /*FALLTHROUGH*/
+      gcc_fallthrough ();
       case 4:
         hval += asso_values[(unsigned char)str[3]];
       /*FALLTHROUGH*/
+      gcc_fallthrough ();
       case 3:
         hval += asso_values[(unsigned char)str[2]];
       /*FALLTHROUGH*/
+      gcc_fallthrough ();
       case 2:
         hval += asso_values[(unsigned char)str[1]];
       /*FALLTHROUGH*/
+      gcc_fallthrough ();
       case 1:
         hval += asso_values[(unsigned char)str[0]];
         break;
diff --git gcc/gcc/cp/class.c gcc/gcc/cp/class.c
index 31fa4b0..58c88fb 100644
--- gcc/gcc/cp/class.c
+++ gcc/gcc/cp/class.c
@@ -7392,6 +7392,7 @@ fixed_type_or_null (tree instance, int *nonnull, int 
*cdtorp)
          return TREE_TYPE (TREE_TYPE (instance));
        }
       /* fall through...  */
+      gcc_fallthrough ();
     case TARGET_EXPR:
     case PARM_DECL:
     case RESULT_DECL:
@@ -8276,6 +8277,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t 
complain)
       gcc_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR);
 
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case TEMPLATE_ID_EXPR:
       {
diff --git gcc/gcc/cp/constexpr.c gcc/gcc/cp/constexpr.c
index ba40435..3097f24 100644
--- gcc/gcc/cp/constexpr.c
+++ gcc/gcc/cp/constexpr.c
@@ -3842,6 +3842,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, 
tree t,
       if (r)
        break;
       /* else fall through */
+      gcc_fallthrough ();
 
     case PLUS_EXPR:
     case MINUS_EXPR:
@@ -4661,6 +4662,7 @@ potential_constant_expression_1 (tree t, bool want_rval, 
bool strict,
                case IFN_SUB_OVERFLOW:
                case IFN_MUL_OVERFLOW:
                  bail = false;
+                 gcc_fallthrough ();
 
                default:
                  break;
@@ -4976,6 +4978,7 @@ potential_constant_expression_1 (tree t, bool want_rval, 
bool strict,
       if (TYPE_P (TREE_OPERAND (t, 0)))
        return true;
       /* else fall through.  */
+      gcc_fallthrough ();
 
     case REALPART_EXPR:
     case IMAGPART_EXPR:
@@ -5050,6 +5053,8 @@ potential_constant_expression_1 (tree t, bool want_rval, 
bool strict,
            }
          return false;
        }
+      /* XXX Really fallthru?  */
+      gcc_fallthrough ();
     case INIT_EXPR:
       return RECUR (TREE_OPERAND (t, 1), rval);
 
@@ -5127,6 +5132,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);
@@ -5167,6 +5173,7 @@ potential_constant_expression_1 (tree t, bool want_rval, 
bool strict,
     case COMPLEX_EXPR:
       want_rval = true;
       /* Fall through.  */
+      gcc_fallthrough ();
     case ARRAY_REF:
     case ARRAY_RANGE_REF:
     case MEMBER_REF:
@@ -5201,6 +5208,7 @@ potential_constant_expression_1 (tree t, bool want_rval, 
bool strict,
          return false;
        }
       /* Fall through.  */
+      gcc_fallthrough ();
     case IF_STMT:
     case VEC_COND_EXPR:
       /* If the condition is a known constant, we know which of the legs we
diff --git gcc/gcc/cp/cp-gimplify.c gcc/gcc/cp/cp-gimplify.c
index 97b043a..6359b6d 100644
--- gcc/gcc/cp/cp-gimplify.c
+++ gcc/gcc/cp/cp-gimplify.c
@@ -631,6 +631,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, 
gimple_seq *post_p)
       if (TREE_CODE (*expr_p) != INIT_EXPR)
        return GS_OK;
       /* Otherwise fall through.  */
+      gcc_fallthrough ();
     case MODIFY_EXPR:
     modify_expr_case:
       {
@@ -810,6 +811,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, 
gimple_seq *post_p)
          goto modify_expr_case;
        }
       /* Fall through.  */
+      gcc_fallthrough ();
 
     default:
       ret = (enum gimplify_status) c_gimplify_expr (expr_p, pre_p, post_p);
@@ -1345,6 +1347,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void 
*data)
          case OMP_CLAUSE_DEFAULT:
            if (OMP_CLAUSE_DEFAULT_KIND (c) == OMP_CLAUSE_DEFAULT_SHARED)
              omp_ctx.default_shared = true;
+           gcc_fallthrough ();
          default:
            break;
          }
@@ -2006,6 +2009,7 @@ cp_fold (tree x)
 
     case VIEW_CONVERT_EXPR:
       rval_ops = false;
+      gcc_fallthrough ();
     case CONVERT_EXPR:
     case NOP_EXPR:
     case NON_LVALUE_EXPR:
@@ -2054,6 +2058,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:
@@ -2106,6 +2111,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/cp-ubsan.c gcc/gcc/cp/cp-ubsan.c
index 9c8f6e6..0c1512f 100644
--- gcc/gcc/cp/cp-ubsan.c
+++ gcc/gcc/cp/cp-ubsan.c
@@ -210,6 +210,7 @@ cp_ubsan_check_member_access_r (tree *stmt_p, int 
*walk_subtrees, void *data)
          break;
        }
       /* FALLTHRU */
+      gcc_fallthrough ();
     default:
       if (ucmd->is_addr && handled_component_p (stmt))
        {
diff --git gcc/gcc/cp/cvt.c gcc/gcc/cp/cvt.c
index 2e2bac7..e98086f 100644
--- gcc/gcc/cp/cvt.c
+++ gcc/gcc/cp/cvt.c
@@ -1664,6 +1664,7 @@ build_expr_type_conversion (int desires, tree expr, bool 
complain)
        if ((desires & WANT_NULL) && null_ptr_cst_p (expr))
          return expr;
        /* else fall through...  */
+       gcc_fallthrough ();
 
       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 3b52a35..c414f00 100644
--- gcc/gcc/cp/cxx-pretty-print.c
+++ gcc/gcc/cp/cxx-pretty-print.c
@@ -139,6 +139,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:
@@ -150,6 +151,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)
@@ -277,6 +279,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));
@@ -329,6 +332,7 @@ cxx_pretty_printer::constant (tree t)
          break;
        }
       /* else fall through.  */
+      gcc_fallthrough ();
 
     default:
       c_pretty_printer::constant (t);
@@ -414,6 +418,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:
@@ -784,6 +789,7 @@ cxx_pretty_printer::unary_expression (tree t)
          break;
        }
       /* Fall through  */
+      gcc_fallthrough ();
 
     case ALIGNOF_EXPR:
       pp_cxx_ws_string (this, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
@@ -870,6 +876,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t)
          break;
        }
       /* Else fall through.  */
+      gcc_fallthrough ();
     case MEMBER_REF:
     case DOTSTAR_EXPR:
       pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0));
@@ -1054,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:
@@ -1208,6 +1216,7 @@ cxx_pretty_printer::function_specifier (tree t)
        pp_cxx_ws_string (this, "explicit");
       else
         c_pretty_printer::function_specifier (t);
+      gcc_fallthrough ();
 
     default:
       break;
@@ -1250,8 +1259,11 @@ 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);
+       {
+         gcc_fallthrough ();
+         default:
+         c_pretty_printer::declaration_specifiers (t);
+       }
       break;
     }
 }
@@ -1348,6 +1360,7 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
          break;
        }
       /* else fall through */
+      gcc_fallthrough ();
 
     default:
       if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
@@ -1389,6 +1402,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))
        {
@@ -1400,6 +1414,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
          break;
        }
       /* else fall through.  */
+      gcc_fallthrough ();
 
     default:
       pp_unsupported_tree (pp, t);
diff --git gcc/gcc/cp/decl.c gcc/gcc/cp/decl.c
index c86a131..505ee12 100644
--- gcc/gcc/cp/decl.c
+++ gcc/gcc/cp/decl.c
@@ -9446,6 +9446,7 @@ grokdeclarator (const cp_declarator *declarator,
                    }
                }
                /* Fall through.  */
+               gcc_fallthrough ();
 
              case IDENTIFIER_NODE:
                if (identifier_p (decl))
diff --git gcc/gcc/cp/decl2.c gcc/gcc/cp/decl2.c
index 22f9ede..64b1d0d 100644
--- gcc/gcc/cp/decl2.c
+++ gcc/gcc/cp/decl2.c
@@ -1687,11 +1687,13 @@ coerce_new_type (tree type)
     case 2:
       args = tree_cons (NULL_TREE, size_type_node, args);
       /* Fall through.  */
+      gcc_fallthrough ();
     case 1:
       type = build_exception_variant
              (build_function_type (ptr_type_node, args),
               TYPE_RAISES_EXCEPTIONS (type));
       /* Fall through.  */
+      gcc_fallthrough ();
     default:;
   }
   return type;
@@ -1725,11 +1727,13 @@ coerce_delete_type (tree type)
     case 2:
       args = tree_cons (NULL_TREE, ptr_type_node, args);
       /* Fall through.  */
+      gcc_fallthrough ();
     case 1:
       type = build_exception_variant
              (build_function_type (void_type_node, args),
               TYPE_RAISES_EXCEPTIONS (type));
       /* Fall through.  */
+      gcc_fallthrough ();
     default:;
   }
 
diff --git gcc/gcc/cp/dump.c gcc/gcc/cp/dump.c
index 12c2549..d5b93c0 100644
--- gcc/gcc/cp/dump.c
+++ gcc/gcc/cp/dump.c
@@ -253,6 +253,7 @@ cp_dump_tree (void* dump_info, tree t)
          return true;
        }
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case UNION_TYPE:
       /* Is it a type used as a base? */
diff --git gcc/gcc/cp/error.c gcc/gcc/cp/error.c
index d5a7d0f..ab90d7d 100644
--- gcc/gcc/cp/error.c
+++ gcc/gcc/cp/error.c
@@ -451,6 +451,7 @@ dump_type (cxx_pretty_printer *pp, tree t, int flags)
          break;
        }
       /* Else fall through.  */
+      gcc_fallthrough ();
 
     case TEMPLATE_DECL:
     case NAMESPACE_DECL:
@@ -576,6 +577,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>"));
@@ -815,6 +817,7 @@ dump_type_prefix (cxx_pretty_printer *pp, tree t, int flags)
     default:
       pp_unsupported_tree (pp, t);
       /* fall through.  */
+      gcc_fallthrough ();
     case ERROR_MARK:
       pp_string (pp, M_("<typeprefixerror>"));
       break;
@@ -932,6 +935,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags)
 
     default:
       pp_unsupported_tree (pp, t);
+      gcc_fallthrough ();
     case ERROR_MARK:
       /* Don't mark it here, we should have already done in
         dump_type_prefix.  */
@@ -1061,6 +1065,7 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags)
          break;
        }
       /* Else fall through.  */
+      gcc_fallthrough ();
     case FIELD_DECL:
     case PARM_DECL:
       dump_simple_decl (pp, t, TREE_TYPE (t), flags);
@@ -1181,6 +1186,7 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags)
         FUNCTION_DECL.  */
       t = OVL_CURRENT (t);
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case FUNCTION_DECL:
       if (! DECL_LANG_SPECIFIC (t))
@@ -1272,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>"));
@@ -2496,6 +2503,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);
@@ -2758,6 +2766,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/expr.c gcc/gcc/cp/expr.c
index e879f3c..081f62a 100644
--- gcc/gcc/cp/expr.c
+++ gcc/gcc/cp/expr.c
@@ -76,6 +76,7 @@ cplus_expand_constant (tree cst)
        unsigned HOST_WIDE_INT idx;
        FOR_EACH_VEC_SAFE_ELT (CONSTRUCTOR_ELTS (cst), idx, elt)
          elt->value = cplus_expand_constant (elt->value);
+       gcc_fallthrough ();
       }
 
     default:
diff --git gcc/gcc/cp/mangle.c gcc/gcc/cp/mangle.c
index 0e44409..bab20c6 100644
--- gcc/gcc/cp/mangle.c
+++ gcc/gcc/cp/mangle.c
@@ -2052,6 +2052,7 @@ write_type (tree type)
                  break;
                }
              /* else fall through.  */
+             gcc_fallthrough ();
            case TEMPLATE_PARM_INDEX:
              write_template_param (type);
              break;
@@ -3074,6 +3075,7 @@ write_expression (tree expr)
          if (abi_warn_or_compat_version_crosses (6))
            G.need_abi_warning = 1;
          /* Fall through.  */
+         gcc_fallthrough ();
 
        default:
          /* In the middle-end, some expressions have more operands than
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 cbd5209..bcd3b92 100644
--- gcc/gcc/cp/name-lookup.c
+++ gcc/gcc/cp/name-lookup.c
@@ -1575,6 +1575,7 @@ begin_scope (scope_kind kind, tree entity)
       scope->explicit_spec_p = true;
       kind = sk_template_parms;
       /* Fall through.  */
+      gcc_fallthrough ();
     case sk_template_parms:
     case sk_block:
     case sk_try:
@@ -5547,6 +5548,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 ef35aa9..26386fa 100644
--- gcc/gcc/cp/parser.c
+++ gcc/gcc/cp/parser.c
@@ -1258,6 +1258,7 @@ cp_lexer_print_token (FILE * stream, cp_token *token)
       if (!identifier_p (token->u.value))
        break;
       /* else fall through */
+      gcc_fallthrough ();
     case CPP_NAME:
       fputs (IDENTIFIER_POINTER (token->u.value), stream);
       break;
@@ -3467,6 +3468,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;
@@ -5118,6 +5120,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;
@@ -5447,6 +5450,7 @@ cp_parser_id_expression (cp_parser *parser,
          if (token->keyword == RID_OPERATOR)
            return cp_parser_operator_function_id (parser);
          /* Fall through.  */
+         gcc_fallthrough ();
 
        default:
          cp_parser_error (parser, "expected id-expression");
@@ -5778,6 +5782,7 @@ cp_parser_unqualified_id (cp_parser* parser,
          return id;
        }
       /* Fall through.  */
+      gcc_fallthrough ();
 
     default:
       if (optional_p)
@@ -7935,6 +7940,7 @@ cp_parser_unary_expression (cp_parser *parser, cp_id_kind 
* pidk,
        case ADDR_EXPR:
           non_constant_p = NIC_ADDR;
          /* Fall through.  */
+         gcc_fallthrough ();
        case BIT_NOT_EXPR:
          expression = build_x_unary_op (loc, unary_operator,
                                         cast_expression,
@@ -7949,6 +7955,7 @@ cp_parser_unary_expression (cp_parser *parser, cp_id_kind 
* pidk,
          non_constant_p = unary_operator == PREINCREMENT_EXPR
                           ? NIC_PREINCREMENT : NIC_PREDECREMENT;
          /* Fall through.  */
+         gcc_fallthrough ();
        case NEGATE_EXPR:
          /* Immediately fold negation of a constant, unless the constant is 0
             (since -0 == 0) or it would overflow.  */
@@ -7967,6 +7974,7 @@ cp_parser_unary_expression (cp_parser *parser, cp_id_kind 
* pidk,
                }
            }
          /* Fall through.  */
+         gcc_fallthrough ();
        case UNARY_PLUS_EXPR:
        case TRUTH_NOT_EXPR:
          expression = finish_unary_op_expr (loc, unary_operator,
@@ -9410,6 +9418,7 @@ cp_parser_builtin_offsetof (cp_parser *parser)
          expr = grok_array_decl (token->location, expr,
                                  integer_zero_node, false);
          /* FALLTHRU */
+         gcc_fallthrough ();
 
        case CPP_DOT:
          /* offsetof-member-designator "." identifier */
@@ -11777,6 +11786,7 @@ cp_parser_jump_statement (cp_parser* parser)
          error_at (token->location,
                    "continue statement within %<#pragma simd%> loop body");
          /* Fall through.  */
+         gcc_fallthrough ();
        case IN_ITERATION_STMT:
        case IN_OMP_FOR:
          statement = finish_continue_stmt ();
@@ -12854,6 +12864,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:
@@ -13973,6 +13984,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:
@@ -15854,12 +15866,14 @@ cp_parser_type_specifier (cp_parser* parser,
        }
 
       /* Fall through.  */
+      gcc_fallthrough ();
     elaborated_type_specifier:
       /* We're declaring (not defining) a class or enum.  */
       if (declares_class_or_enum)
        *declares_class_or_enum = 1;
 
       /* Fall through.  */
+      gcc_fallthrough ();
     case RID_TYPENAME:
       /* Look for an elaborated-type-specifier.  */
       type_spec
@@ -27083,6 +27097,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)
@@ -27500,6 +27515,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 `]',
@@ -27538,6 +27554,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)
@@ -29068,6 +29085,7 @@ cp_parser_objc_declaration (cp_parser* parser, tree 
attributes)
                      "prefix attributes are ignored before %<@%D%>",
                      kwd->u.value);
          attributes = NULL;
+         gcc_fallthrough ();
        default:
          break;
       }
@@ -30010,6 +30028,7 @@ cp_parser_omp_var_list_no_open (cp_parser *parser, enum 
omp_clause_code kind,
                  break;
                }
              /* FALLTHROUGH.  */
+             gcc_fallthrough ();
            case OMP_CLAUSE_MAP:
            case OMP_CLAUSE_FROM:
            case OMP_CLAUSE_TO:
@@ -30026,6 +30045,7 @@ cp_parser_omp_var_list_no_open (cp_parser *parser, enum 
omp_clause_code kind,
                                                              &idk, loc);
                }
              /* FALLTHROUGH.  */
+             gcc_fallthrough ();
            case OMP_CLAUSE_DEPEND:
            case OMP_CLAUSE_REDUCTION:
              while (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
@@ -32807,6 +32827,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token 
*pragma_tok)
          if (!cp_parser_require (parser, CPP_EQ, RT_EQ))
            goto saw_error;
        }
+      gcc_fallthrough ();
     default:
       break;
     }
@@ -32823,6 +32844,7 @@ restart:
       if (code == OMP_ATOMIC_CAPTURE_NEW && !structured_block)
        code = OMP_ATOMIC_CAPTURE_OLD;
       /* FALLTHROUGH */
+      gcc_fallthrough ();
     case PREINCREMENT_EXPR:
       lhs = TREE_OPERAND (lhs, 0);
       opcode = PLUS_EXPR;
@@ -32833,6 +32855,7 @@ restart:
       if (code == OMP_ATOMIC_CAPTURE_NEW && !structured_block)
        code = OMP_ATOMIC_CAPTURE_OLD;
       /* FALLTHROUGH */
+      gcc_fallthrough ();
     case PREDECREMENT_EXPR:
       lhs = TREE_OPERAND (lhs, 0);
       opcode = MINUS_EXPR;
@@ -32850,6 +32873,7 @@ restart:
        /* Undo effects of boolean_increment for post {in,de}crement.  */
        lhs = TREE_OPERAND (TREE_OPERAND (lhs, 1), 0);
       /* FALLTHRU */
+      gcc_fallthrough ();
     case MODIFY_EXPR:
       if (TREE_CODE (lhs) == MODIFY_EXPR
         && TREE_CODE (TREE_TYPE (TREE_OPERAND (lhs, 0))) == BOOLEAN_TYPE)
@@ -32869,6 +32893,7 @@ restart:
            }
        }
       /* FALLTHRU */
+      gcc_fallthrough ();
     default:
       switch (cp_lexer_peek_token (parser->lexer)->type)
        {
@@ -33035,6 +33060,7 @@ restart:
            goto saw_error;
          goto stmt_done;
          /* FALLTHROUGH */
+         gcc_fallthrough ();
        default:
          cp_parser_error (parser,
                           "invalid operator for %<#pragma omp atomic%>");
@@ -33180,6 +33206,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 c5f65a7..d667360 100644
--- gcc/gcc/cp/pt.c
+++ gcc/gcc/cp/pt.c
@@ -2689,6 +2689,7 @@ check_explicit_specialization (tree declarator,
       error ("template parameter list used in explicit instantiation");
 
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case tsk_expl_inst:
       if (have_def)
@@ -2709,6 +2710,7 @@ check_explicit_specialization (tree declarator,
              "%<template <>%>", decl);
 
       /* Fall through.  */
+      gcc_fallthrough ();
     case tsk_expl_spec:
       if (is_concept)
         error ("explicit specialization declared %<concept%>");
@@ -3453,6 +3455,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
@@ -3540,6 +3543,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, 
void* data)
       if (TYPE_PTRMEMFUNC_P (t))
        return NULL_TREE;
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case UNION_TYPE:
     case ENUMERAL_TYPE:
@@ -6748,6 +6752,7 @@ coerce_template_template_parm (tree parm,
          return 0;
       }
       /* Fall through.  */
+      gcc_fallthrough ();
       
     case TYPE_DECL:
       if (TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (arg))
@@ -8794,6 +8799,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, 
void *d)
       if (TYPE_PTRMEMFUNC_P (t))
        break;
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case UNION_TYPE:
     case ENUMERAL_TYPE:
@@ -8813,6 +8819,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, 
void *d)
         explicitly here.  */
       WALK_SUBTREE (TYPE_METHOD_BASETYPE (t));
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case FUNCTION_TYPE:
       /* Check the return type.  */
@@ -8850,6 +8857,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, 
void *d)
       if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t))
        WALK_SUBTREE (DECL_TI_ARGS (t));
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case PARM_DECL:
     case CONST_DECL:
@@ -8864,6 +8872,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, 
void *d)
       /* Record template parameters such as `T' inside `TT<T>'.  */
       WALK_SUBTREE (TYPE_TI_ARGS (t));
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case TEMPLATE_TEMPLATE_PARM:
     case TEMPLATE_TYPE_PARM:
@@ -11435,6 +11444,7 @@ tsubst_aggr_type (tree t,
        return tsubst (TYPE_PTRMEMFUNC_FN_TYPE (t), args, complain, in_decl);
 
       /* Else fall through.  */
+      gcc_fallthrough ();
     case ENUMERAL_TYPE:
     case UNION_TYPE:
       if (TYPE_TEMPLATE_INFO (t) && uses_template_parms (t))
@@ -14246,6 +14256,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t 
complain, tree in_decl)
          return r;
        }
       /* Fall through */
+      gcc_fallthrough ();
 
     case INDIRECT_REF:
     case NEGATE_EXPR:
@@ -14464,6 +14475,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t 
complain, tree in_decl)
     case USING_DECL:
       t = DECL_NAME (t);
       /* Fall through.  */
+      gcc_fallthrough ();
     case IDENTIFIER_NODE:
       if (IDENTIFIER_TYPENAME_P (t))
        {
@@ -14621,6 +14633,7 @@ tsubst_omp_clauses (tree clauses, enum 
c_omp_region_type ort,
                = pop_stmt_list (OMP_CLAUSE_LASTPRIVATE_STMT (nc));
            }
          /* FALLTHRU */
+         gcc_fallthrough ();
        case OMP_CLAUSE_PRIVATE:
        case OMP_CLAUSE_SHARED:
        case OMP_CLAUSE_FIRSTPRIVATE:
@@ -14783,6 +14796,7 @@ tsubst_omp_clauses (tree clauses, enum 
c_omp_region_type ort,
                          && DECL_NAME (v) == this_identifier)
                        OMP_CLAUSE_DECL (nc) = TREE_OPERAND (t, 1);
                      /* FALLTHRU */
+                     gcc_fallthrough ();
                    default:
                      v = NULL_TREE;
                      break;
@@ -14933,6 +14947,7 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, 
tree orig_declv,
                        decl = omp_privatize_field (decl, false);
                      }
                    /* FALLTHRU */
+                   gcc_fallthrough ();
                  default:
                    v = NULL_TREE;
                    break;
@@ -15618,6 +15633,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t 
complain, tree in_decl,
     case OMP_SECTIONS:
       omp_parallel_combined_clauses = NULL;
       /* FALLTHRU */
+      gcc_fallthrough ();
     case OMP_SINGLE:
     case OMP_TEAMS:
     case OMP_CRITICAL:
@@ -16001,6 +16017,7 @@ tsubst_copy_and_build (tree t,
     case USING_DECL:
       t = DECL_NAME (t);
       /* Fall through.  */
+      gcc_fallthrough ();
     case IDENTIFIER_NODE:
       {
        tree decl;
@@ -16294,6 +16311,7 @@ tsubst_copy_and_build (tree t,
          || ARGUMENT_PACK_P (TREE_OPERAND (t, 0)))
        RETURN (tsubst_copy (t, args, complain, in_decl));
       /* Fall through */
+      gcc_fallthrough ();
       
     case ALIGNOF_EXPR:
       {
@@ -17067,6 +17085,7 @@ tsubst_copy_and_build (tree t,
          return RECUR (DECL_VALUE_EXPR (t));
        }
       /* Fall through */
+      gcc_fallthrough ();
 
     case PARM_DECL:
       {
@@ -20206,12 +20225,14 @@ unify (tree tparms, tree targs, tree parm, tree arg, 
int strict,
                        strict, explain_p);
        }
       /* FALLTHRU */
+      gcc_fallthrough ();
 
     default:
       /* An unresolved overload is a nondeduced context.  */
       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:
@@ -22808,6 +22829,7 @@ value_dependent_expression_p (tree expression)
       if (SIZEOF_EXPR_TYPE_P (expression))
        return dependent_type_p (TREE_TYPE (TREE_OPERAND (expression, 0)));
       /* FALLTHRU */
+      gcc_fallthrough ();
     case ALIGNOF_EXPR:
     case TYPEID_EXPR:
       /* A `sizeof' expression is value-dependent if the operand is
diff --git gcc/gcc/cp/rtti.c gcc/gcc/cp/rtti.c
index 43d5f15..2dcdcde 100644
--- gcc/gcc/cp/rtti.c
+++ gcc/gcc/cp/rtti.c
@@ -539,6 +539,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t 
complain)
       if (VOID_TYPE_P (TREE_TYPE (type)))
        break;
       /* Fall through.  */
+      gcc_fallthrough ();
     case REFERENCE_TYPE:
       if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (type)))
        {
@@ -852,9 +853,11 @@ involves_incomplete_p (tree type)
       if (TYPE_PTRMEMFUNC_P (type))
        goto ptrmem;
       /* Fall through.  */
+      gcc_fallthrough ();
     case UNION_TYPE:
       if (!COMPLETE_TYPE_P (type))
        return true;
+      gcc_fallthrough ();
 
     default:
       /* All other types do not involve incomplete class types.  */
diff --git gcc/gcc/cp/semantics.c gcc/gcc/cp/semantics.c
index d1fb119..d3b753e 100644
--- gcc/gcc/cp/semantics.c
+++ gcc/gcc/cp/semantics.c
@@ -6007,6 +6007,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
@@ -6062,6 +6063,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
@@ -6208,11 +6210,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:
@@ -6814,6 +6818,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
@@ -7210,6 +7215,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type 
ort)
              continue;
            }
          /* FALLTHRU */
+         gcc_fallthrough ();
        default:
          pc = &OMP_CLAUSE_CHAIN (c);
          continue;
@@ -8875,6 +8881,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 fa8db0a..d026c4a 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:
@@ -1708,6 +1710,7 @@ strip_typedefs_expr (tree t, bool *remove_attributes)
     case NEW_EXPR:
       type = strip_typedefs (type, remove_attributes);
       /* fallthrough */
+      gcc_fallthrough ();
 
     default:
       for (i = 0; i < n; ++i)
@@ -2343,10 +2346,12 @@ no_linkage_check (tree t, bool relaxed_p)
          && LAMBDA_TYPE_EXTRA_SCOPE (t) == NULL_TREE)
        return t;
       /* Fall through.  */
+      gcc_fallthrough ();
     case UNION_TYPE:
       if (!CLASS_TYPE_P (t))
        return NULL_TREE;
       /* Fall through.  */
+      gcc_fallthrough ();
     case ENUMERAL_TYPE:
       /* Only treat anonymous types as having no linkage if they're at
         namespace scope.  This is core issue 966.  */
@@ -2548,6 +2553,7 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
          case BUILT_IN_FILE:
          case BUILT_IN_LINE:
            SET_EXPR_LOCATION (*tp, input_location);
+           gcc_fallthrough ();
          default:
            break;
          }
diff --git gcc/gcc/cp/typeck.c gcc/gcc/cp/typeck.c
index fb6a16e..74f008c 100644
--- gcc/gcc/cp/typeck.c
+++ gcc/gcc/cp/typeck.c
@@ -1278,6 +1278,7 @@ structural_comptypes (tree t1, tree t2, int strict)
       /* Don't check inheritance.  */
       strict = COMPARE_STRICT;
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case RECORD_TYPE:
     case UNION_TYPE:
@@ -1306,6 +1307,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)
@@ -1884,6 +1886,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
          == TYPE_MAIN_VARIANT (TREE_TYPE (exp)))
        return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0));
       /* Fallthrough.  */
+      gcc_fallthrough ();
 
     default:
       return NULL_TREE;
@@ -4260,6 +4263,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))
@@ -5040,6 +5044,7 @@ cp_build_binary_op (location_t location,
                  op1 = save_expr (op1);
                  imag = build2 (resultcode, real_type, imag, op1);
                  /* Fall through.  */
+                 gcc_fallthrough ();
                case PLUS_EXPR:
                case MINUS_EXPR:
                  real = build2 (resultcode, real_type, real, op1);
@@ -5059,6 +5064,7 @@ cp_build_binary_op (location_t location,
                  op0 = save_expr (op0);
                  imag = build2 (resultcode, real_type, op0, imag);
                  /* Fall through.  */
+                 gcc_fallthrough ();
                case PLUS_EXPR:
                  real = build2 (resultcode, real_type, op0, real);
                  break;
@@ -5693,6 +5699,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, 
tsubst_flags_t complain)
     case BASELINK:
       arg = BASELINK_FUNCTIONS (arg);
       /* Fall through.  */
+      gcc_fallthrough ();
 
     case OVERLOAD:
       arg = OVL_CURRENT (arg);
@@ -6222,6 +6229,7 @@ cxx_mark_addressable (tree exp)
            return true;
          }
        /* Fall through.  */
+      gcc_fallthrough ();
 
       case VAR_DECL:
        /* Caller should not be trying to mark initialized
@@ -6231,6 +6239,7 @@ cxx_mark_addressable (tree exp)
                    || TREE_STATIC (x)
                    || DECL_EXTERNAL (x));
        /* Fall through.  */
+      gcc_fallthrough ();
 
       case RESULT_DECL:
        if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
@@ -7555,6 +7564,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/cp/typeck2.c gcc/gcc/cp/typeck2.c
index 65d91c9..47728f2 100644
--- gcc/gcc/cp/typeck2.c
+++ gcc/gcc/cp/typeck2.c
@@ -612,6 +612,7 @@ split_nonconstant_init_1 (tree dest, tree init)
          return true;
        }
       /* FALLTHRU */
+      gcc_fallthrough ();
 
     case RECORD_TYPE:
     case UNION_TYPE:

Reply via email to