From patchwork Tue Apr 4 09:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 78938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2877365vqo; Tue, 4 Apr 2023 02:02:09 -0700 (PDT) X-Google-Smtp-Source: AKy350Yf97FJdacKL0TMdxoj1ybKN64Axx3jcn0MxxVPtY6m4KS9xHX43RNymmEcmfqvu5aSFqw6 X-Received: by 2002:a17:906:58d6:b0:947:792d:bf7e with SMTP id e22-20020a17090658d600b00947792dbf7emr1907158ejs.58.1680598928896; Tue, 04 Apr 2023 02:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680598928; cv=none; d=google.com; s=arc-20160816; b=Rz98uwsBx+dP4XS0WdJuqxm6IBdXfc8fJ2Vj5DsKVJChqKBTZvzurTMVQ/AR3H0/xp argH1SqyS/9LY9V48MCJ7a937csszmcNrarggZYVVLUFr8i6wgHazUZkAauGqUqpNj5Y wzvUoacXMzcu9bmXEr4dkMyKDuw747sV++iLMpX7FSAP9h9ics98QHn9OF5pSGQjOhM2 lU5uFxRWvgr0x8KpGGdeKm24Oy0yWvOkJyqh52sp+ahP+lGJkgStUKPGVT2EGB9jsIs2 bZQyCRwAc8Y12NWeoDGb+F8isiCnCSZeRbtNh2TQVPPvpT1fAJhORwIneiBvgL1ws7Vp /msw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=x84sKwKVnb/MTDlJYfF9juoVzzDMuk2ivF2wC2X1fno=; b=CTVQslSo1J7El36MWXD7ee+I5hzJvWc4yp4gMD/wHnCqe9m62u6V7TVz977NOU4Btr W8hSc6T77dN3x5nITOu0+G6kUuOyIRIIBaB+pdCeki2peuovdrQEowFxHDzVs0WF+1JU 39Ip0RzrVAv0uf5L0Gnzg1LXia6lZRyeW1cVE+KOQthuzbOa1NoK6zSFFdenCy32PupW M/dzXInd5MMmwDiNuLBRYt+qmPf4kj0g+AZvPPPT5EnNsS0/ExaBiVmwzk/E0FxYTraL x1AUcYiJkBZXtTtKJpNGw75BfActqkfmO2f5XFss872/VP6xdrFVxdwv3xJqle0au52e N3gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lSt8sUPC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z3-20020a1709063ac300b0092d0f8f0111si6408833ejd.340.2023.04.04.02.02.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 02:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lSt8sUPC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ADA2E385841A for ; Tue, 4 Apr 2023 09:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADA2E385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680598927; bh=x84sKwKVnb/MTDlJYfF9juoVzzDMuk2ivF2wC2X1fno=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=lSt8sUPCxvI+yVq4412kUQzYwzK297ke9JPd3IBVHtc0Zs1/GFkEqIU8yZ5QPPNaT jw90aCQSRRrWLXWM+B0a7747JqGUcPsIt2FkSS9/ndcp8w6Kz/ACnimb4OMdsawqRD XuMGRZvxkOpoA3Ehvn5t2WAh6WKgSSrDKj5KbdTo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DF8753858D1E for ; Tue, 4 Apr 2023 09:01:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF8753858D1E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-183-4QyezaQlOjG95j6afCrATw-1; Tue, 04 Apr 2023 05:01:22 -0400 X-MC-Unique: 4QyezaQlOjG95j6afCrATw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF444811E7C; Tue, 4 Apr 2023 09:01:21 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 725C12027061; Tue, 4 Apr 2023 09:01:21 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 33491Juf1764606 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 4 Apr 2023 11:01:19 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 33491IDA1764605; Tue, 4 Apr 2023 11:01:18 +0200 Date: Tue, 4 Apr 2023 11:01:18 +0200 To: Kito Cheng , Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] riscv: Fix bootstrap [PR109384] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762235702337948658?= X-GMAIL-MSGID: =?utf-8?q?1762235702337948658?= Hi! The following patch unbreaks riscv bootstrap, where it previously failed on -Werror=format-diag warning promoted to error. Ok for trunk? Or shall it say e.g. "%<-march=%s%>: % extension conflicts with %" ? Or say if the current condition is true, do const char *ext = "zfinx"; if (subset_list->lookup ("zdinx")) ext = "zdinx"; else if (subset_list->lookup ("zhinx")) ext = "zhinx"; else if (subset_list->lookup ("zhinxmin")) ext = "zhinxmin"; and "%<-march=%s%>: %qs extension conflicts with %", arch, ext ? Or do similar check for which extension to print against it, const char *ext = "zfinx"; const char *ext2 = "f"; if (subset_list->lookup ("zdinx")) { ext = "zdinx"; if (subset_list->lookup ("d")) ext2 = "d"; } else if (subset_list->lookup ("zhinx")) { ext = "zhinx"; if (subset_list->lookup ("zfh")) ext2 = "zfh"; } else if (subset_list->lookup ("zhinxmin")) { ext = "zhinxmin"; if (subset_list->lookup ("zfhmin")) ext2 = "zfhmin"; } "%<-march=%s%>: %qs extension conflicts with %qs", arch, ext, ext2 ? 2023-04-04 Jakub Jelinek PR target/109384 * common/config/riscv/riscv-common.cc (riscv_subset_list::parse): Reword diagnostics about zfinx conflict with f, formatting fixes. * gcc.target/riscv/arch-19.c: Expect a different message about zfinx vs. f conflict. Jakub --- gcc/common/config/riscv/riscv-common.cc.jj 2023-04-04 10:46:33.473871184 +0200 +++ gcc/common/config/riscv/riscv-common.cc 2023-04-04 10:41:22.014477456 +0200 @@ -1153,10 +1153,9 @@ riscv_subset_list::parse (const char *ar subset_list->handle_combine_ext (); - if (subset_list->lookup("zfinx") && subset_list->lookup("f")) - error_at (loc, - "%<-march=%s%>: z*inx is conflict with float extensions", - arch); + if (subset_list->lookup ("zfinx") && subset_list->lookup ("f")) + error_at (loc, "%<-march=%s%>: z*inx conflicts with floating-point " + "extensions", arch); return subset_list; --- gcc/testsuite/gcc.target/riscv/arch-19.c.jj 2023-03-29 22:37:11.465651690 +0200 +++ gcc/testsuite/gcc.target/riscv/arch-19.c 2023-04-04 10:45:50.734503089 +0200 @@ -1,4 +1,4 @@ /* { dg-do compile } */ /* { dg-options "-march=rv64if_zfinx -mabi=lp64" } */ int foo() {} -/* { dg-error "'-march=rv64if_zfinx': z\\*inx is conflict with float extensions" "" { target *-*-* } 0 } */ +/* { dg-error "'-march=rv64if_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */