From patchwork Mon Jul 11 19:56:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 647062 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 3rpG7Q6lw2z9sCY for ; Tue, 12 Jul 2016 05:56:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ePiZ67Ej; 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=vWGKuXnBTN7nzkeSLjwP0bdofF30zg iobKg/nh4YoCSLwMrWBY9lAeQaRuUmSbP0TLFZjjBVdk+Ldlg7ZRUihhLuWUvt11 UPWSnuMkGgO2A6e3tGtlxPNdOEnFzKixjFOGV8BR2/Y44PHYGjBYW8bVIptISqm4 e+cvxa9ZMMOR4= 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=ocidFCcU36SsAD5lH9Ztqu9bnu4=; b=ePiZ 67Eja02fLlRTMYfriHJIt3bXDQEcR8bf3aEB2YcFy4YFGtoxDlnnW0eK23j7CYgi INuGj8Xr6sOm9CKaaLRS1XJQ1C57PDTdxnhdraEYtY7YBMrMkeiNfGAPuc+BzCxz mueakRPTuol50Wy7d/KKaFbM70WKZPJAqhQidNo= Received: (qmail 130104 invoked by alias); 11 Jul 2016 19:56:12 -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 130093 invoked by uid 89); 11 Jul 2016 19:56:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=unpacking, Hx-languages-length:1723 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 11 Jul 2016 19:56:10 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E5953F720 for ; Mon, 11 Jul 2016 19:56:09 +0000 (UTC) Received: from redhat.com (ovpn-204-85.brq.redhat.com [10.40.204.85]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6BJu625026693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 11 Jul 2016 15:56:08 -0400 Date: Mon, 11 Jul 2016 21:56:06 +0200 From: Marek Polacek To: GCC Patches Subject: Re: Implement -Wswitch-fallthrough: libgcc Message-ID: <20160711195606.GV13963@redhat.com> References: <20160711194340.GI13963@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160711194340.GI13963@redhat.com> User-Agent: Mutt/1.6.1 (2016-04-27) 2016-07-11 Marek Polacek PR c/7652 * soft-fp/soft-fp.h (_FP_FALLTHRU): Define. * soft-fp/op-common.h: Use it. diff --git gcc/libgcc/soft-fp/op-common.h gcc/libgcc/soft-fp/op-common.h index 080ef0e..6691f50 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..999b145 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() __builtin_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