From patchwork Mon Sep 26 13:34:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 675160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sjQ200j3Rz9sBr for ; Mon, 26 Sep 2016 23:35:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=EFxsl/Kj; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=RI3MC6q/hgaV740G uD33x75Dge3WnRagevc6PBmeNT7kDqAegfmsJ9XizFYGP+a7EvTqiZlhbrX5vhFc Hd5Wq6RzEqHdRgRVX63UzmF/X9znMGL20R4H26y8Id6jrDWVTOB4kI9cZTv62ynQ nPcrDYBzEcipOJAD/YS/UUySFes= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=JXa4Rdvd0LmB49tJz9Hidl JeUaQ=; b=EFxsl/KjC7m3ud6Ah+naVue2ulXQHOl1YK8fgN6SdX5CVp4AH1HfQL 52TBUDIOrpKpsp57UNVt+0qARrfPeqCQ/E5azcnx8/iL9DnNpxQ6/UZanSJDzD5J XtkNitN+n9Y3vSc5lRp5eHYpibzjJhu8CUxLoCCN5fJpayiEfzhIY= Received: (qmail 65096 invoked by alias); 26 Sep 2016 13:34:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 65084 invoked by uid 89); 26 Sep 2016 13:34:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=misspelled, Present, 10117, 5967 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Sep 2016 13:34:49 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 55493912; Mon, 26 Sep 2016 15:34:47 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XTfGyurOIYgQ; Mon, 26 Sep 2016 15:34:41 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 842D6911; Mon, 26 Sep 2016 15:34:41 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id u8QDYeeK002639; Mon, 26 Sep 2016 15:34:40 +0200 (MEST) From: Rainer Orth To: Marek Polacek Cc: Joseph Myers , Jason Merrill , GCC Patches , Jakub Jelinek , Arnaud Charlet , Eric Botcazou Subject: Re: Implement -Wimplicit-fallthrough (version 9) References: <20160920153343.GF19950@redhat.com> <4fe27051-f842-ef50-e798-efe543de07bf@redhat.com> <20160921124440.GM19950@redhat.com> <20160921185905.GQ19950@redhat.com> <20160922135917.GT19950@redhat.com> <20160923142614.GD3223@redhat.com> <20160924094226.GF3223@redhat.com> Date: Mon, 26 Sep 2016 15:34:40 +0200 In-Reply-To: <20160924094226.GF3223@redhat.com> (Marek Polacek's message of "Sat, 24 Sep 2016 11:42:26 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Marek, > All right. I'll commit the patch on Monday. this patch caused quite some breakage: Ada, Solaris/x86 and SPARC don't bootstrap any longer. The following patch allows i386-pc-solaris2.12 and sparc-sun-solaris2.12 bootstraps continue. Strangely, I needed to use gcc_fallthrough () in i386.c; a mere /* FALLTHRU */ had no effect. Ok for mainline if the bootstraps pass (with appropriate changelog entries, of course)? Rainer diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -596,7 +596,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit gnu_expr = gnat_to_gnu_external (Expression (Declaration_Node (gnat_entity))); - /* ... fall through ... */ + /* fall through */ case E_Exception: case E_Loop_Parameter: @@ -3369,7 +3369,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit break; } - /* ... fall through ... */ + /* fall through */ case E_Record_Subtype: /* If Cloned_Subtype is Present it means this record subtype has @@ -3804,7 +3804,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit break; } - /* ... fall through ... */ + /* fall through */ case E_Allocator_Type: case E_Access_Type: @@ -6882,7 +6882,7 @@ choices_to_gnu (tree operand, Node_Id ch break; } - /* ... fall through ... */ + /* fall through */ case N_Character_Literal: case N_Integer_Literal: @@ -8089,7 +8089,7 @@ annotate_value (tree gnu_size) else return Uint_Minus_1; - /* Fall through... */ + /* fall through */ default: return No_Uint; diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -157,7 +157,7 @@ gnat_handle_option (size_t scode, const case OPT_gant: warning (0, "%<-gnat%> misspelled as %<-gant%>"); - /* ... fall through ... */ + /* fall through */ case OPT_gnat: case OPT_gnatO: @@ -486,13 +486,13 @@ gnat_print_type (FILE *file, tree node, else print_node (file, "index type", TYPE_INDEX_TYPE (node), indent + 4); - /* ... fall through ... */ + /* fall through */ case ENUMERAL_TYPE: case BOOLEAN_TYPE: print_node_brief (file, "RM size", TYPE_RM_SIZE (node), indent + 4); - /* ... fall through ... */ + /* fall through */ case REAL_TYPE: print_node_brief (file, "RM min", TYPE_RM_MIN_VALUE (node), indent + 4); diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -844,7 +844,7 @@ lvalue_required_p (Node_Id gnat_node, tr && Ekind (Entity (gnat_temp)) == E_Enumeration_Literal)) return 1; - /* ... fall through ... */ + /* fall through */ case N_Slice: /* Only the array expression can require an lvalue. */ @@ -890,7 +890,7 @@ lvalue_required_p (Node_Id gnat_node, tr if (!constant) return 1; - /* ... fall through ... */ + /* fall through */ case N_Type_Conversion: case N_Qualified_Expression: @@ -914,7 +914,7 @@ lvalue_required_p (Node_Id gnat_node, tr get_unpadded_type (Etype (gnat_parent)), true, false, true); - /* ... fall through ... */ + /* fall through */ default: return 0; @@ -1681,7 +1681,7 @@ Attribute_to_gnu (Node_Id gnat_node, tre break; } - /* ... fall through ... */ + /* fall through */ case Attr_Access: case Attr_Unchecked_Access: @@ -1938,7 +1938,7 @@ Attribute_to_gnu (Node_Id gnat_node, tre break; } - /* ... fall through ... */ + /* fall through */ case Attr_Length: { @@ -2393,7 +2393,7 @@ Attribute_to_gnu (Node_Id gnat_node, tre /* We treat Model as identical to Machine. This is true for at least IEEE and some other nice floating-point systems. */ - /* ... fall through ... */ + /* fall through */ case Attr_Machine: /* The trick is to force the compiler to store the result in memory so @@ -2537,7 +2537,7 @@ Case_Statement_to_gnu (Node_Id gnat_node break; } - /* ... fall through ... */ + /* fall through */ case N_Character_Literal: case N_Integer_Literal: @@ -4007,7 +4007,7 @@ node_is_atomic (Node_Id gnat_node) && Has_Atomic_Components (Entity (Prefix (gnat_node)))) return true; - /* ... fall through ... */ + /* fall through */ case N_Explicit_Dereference: return Is_Atomic (Etype (gnat_node)); @@ -4123,7 +4123,7 @@ atomic_access_required_p (Node_Id gnat_n /* Nothing to do if we are the prefix of an attribute, since we do not want an atomic access for things like 'Size. */ - /* ... fall through ... */ + /* fall through */ case N_Reference: /* The N_Reference node is like an attribute. */ @@ -6580,7 +6580,7 @@ gnat_to_gnu (Node_Id gnat_node) break; } - /* ... fall through ... */ + /* fall through */ case N_Op_Eq: case N_Op_Ne: @@ -6747,7 +6747,7 @@ gnat_to_gnu (Node_Id gnat_node) break; } - /* ... fall through ... */ + /* fall through */ case N_Op_Minus: case N_Op_Abs: @@ -8344,7 +8344,7 @@ gnat_gimplify_expr (tree *expr_p, gimple break; } - /* ... fall through ... */ + /* fall through */ default: return GS_UNHANDLED; @@ -9867,7 +9867,7 @@ set_gnu_expr_location_from_node (tree no if (EXPR_P (TREE_OPERAND (node, 1))) set_gnu_expr_location_from_node (TREE_OPERAND (node, 1), gnat_node); - /* ... fall through ... */ + /* fall through */ default: if (!REFERENCE_CLASS_P (node) && !EXPR_HAS_LOCATION (node)) diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3166,7 +3166,7 @@ create_subprog_decl (tree name, tree asm NULL_TREE, NULL_TREE), ATTR_FLAG_TYPE_IN_PLACE); - /* ... fall through ... */ + /* fall through */ case is_enabled: DECL_DECLARED_INLINE_P (subprog_decl) = 1; @@ -4271,6 +4271,8 @@ convert (tree type, tree expr) return expr; } + /* fall through */ + case CONSTRUCTOR: /* If we are converting a CONSTRUCTOR to a mere type variant, or to another padding type around the same type, just make a new one in @@ -4508,7 +4510,7 @@ convert (tree type, tree expr) convert (TREE_TYPE (type), TYPE_MIN_VALUE (type)))); - /* ... fall through ... */ + /* fall through */ case ENUMERAL_TYPE: case BOOLEAN_TYPE: @@ -4585,7 +4587,7 @@ convert (tree type, tree expr) return gnat_build_constructor (type, v); } - /* ... fall through ... */ + /* fall through */ case ARRAY_TYPE: /* In these cases, assume the front-end has validated the conversion. @@ -4701,7 +4703,7 @@ convert_to_index_type (tree expr) break; } - /* ... fall through ... */ + /* fall through */ case NON_LVALUE_EXPR: return fold_build1 (code, sizetype, diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -180,7 +180,7 @@ known_alignment (tree exp) return known_alignment (t); } - /* ... fall through ... */ + /* fall through */ default: /* For other pointer expressions, we assume that the pointed-to object @@ -1011,7 +1011,7 @@ build_binary_op (enum tree_code op_code, if (!operation_type) operation_type = TREE_TYPE (left_type); - /* ... fall through ... */ + /* fall through */ case ARRAY_RANGE_REF: /* First look through conversion between type variants. Note that @@ -1230,7 +1230,7 @@ build_binary_op (enum tree_code op_code, op_code = MINUS_EXPR; modulus = NULL_TREE; - /* ... fall through ... */ + /* fall through */ case PLUS_EXPR: case MINUS_EXPR: @@ -1244,7 +1244,7 @@ build_binary_op (enum tree_code op_code, = gnat_type_for_mode (TYPE_MODE (operation_type), TYPE_UNSIGNED (operation_type)); - /* ... fall through ... */ + /* fall through */ default: common: @@ -1466,7 +1466,7 @@ build_unary_op (enum tree_code op_code, return build_unary_op (ADDR_EXPR, result_type, TREE_OPERAND (operand, 0)); - /* ... fallthru ... */ + /* fallthru */ case VIEW_CONVERT_EXPR: /* If this just a variant conversion or if the conversion doesn't @@ -1487,7 +1487,7 @@ build_unary_op (enum tree_code op_code, case CONST_DECL: operand = DECL_CONST_CORRESPONDING_VAR (operand); - /* ... fall through ... */ + /* fall through */ default: common: @@ -1648,7 +1648,7 @@ build_unary_op (enum tree_code op_code, } } - /* ... fall through ... */ + /* fall through */ default: gcc_assert (operation_type == base_type); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -17917,6 +17917,7 @@ ix86_print_operand (FILE *file, rtx x, i #ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX if (ASSEMBLER_DIALECT == ASM_ATT) putc ('.', file); + gcc_fallthrough (); #endif case 'C': diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3832,6 +3832,7 @@ check_pic (int i) || (GET_CODE (XEXP (op, 0)) == MINUS && XEXP (XEXP (op, 0), 0) == sparc_got () && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST))); + /* fallthrough */ case 2: default: return 1; @@ -8371,6 +8372,7 @@ epilogue_renumber (register rtx *where, return 1; if (! test && REGNO (*where) >= 24 && REGNO (*where) < 32) *where = gen_rtx_REG (GET_MODE (*where), OUTGOING_REGNO (REGNO(*where))); + /* fallthrough */ case SCRATCH: case CC0: case PC: