Message ID | 20220828110925.gxuejmyvilvqy66h@lug-owl.de |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp979307wro; Sun, 28 Aug 2022 04:10:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jPpj2dRMHOnl+tYj8I/jEZP3Cf9MjsvoWOpnumSmwpWVUg+NCenUZz8hGbMC8m/bgfuzg X-Received: by 2002:a17:907:7f20:b0:73d:d54f:6571 with SMTP id qf32-20020a1709077f2000b0073dd54f6571mr9283274ejc.315.1661685015001; Sun, 28 Aug 2022 04:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661685014; cv=none; d=google.com; s=arc-20160816; b=MkFFyavk2iLtObXHiMxG0KOmQKnZXT72FKNgyt2AQ9tgWMF41ZQsAy1+FoDmh6rzqJ gKRJDdu8MfYppEkTSRqALDMM0q0hpqN2jXvv70FHytNO8ExEtbxkEr/4539G6wPMjeh/ 8cSR5/hamWv55CbMQOW7PZmbsES/eAuKn6KpOQstcsb3UG/eVqNmsOYh3ERI8kHN+7eZ ZLrEpWLAQTorwiiFWBu30nT5/D8D45FO18f2BwwbBA9cYmlasqbmWhIKMDMz4wzdBigy uGvsw2ZjDYjzlK6F0GHq8QUEtpkn9CGn6D0QiCcm0X89+8NtzACYpge2w5JwTv9lJggq 5rtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dmarc-filter :delivered-to; bh=fI8uLwDv7EXia238CSVen2LtCqsYUiK2ZK1rGsccTco=; b=B04Ds5ysZoZDimY+TrLGA3cukhTvW/LAkh6SqjE4Ks+RRFMddcIE6H7C83OoVnhT6m TouWC8O9rgP3t9QWgqdamRxSEqmBq8kXNydWLyKzu/vs5qR53PusDmsnyqtwoGDHaBxW qpM20/cnTeurK6uHumFNq015mVUfg1CzDvQAHPhP4DgzhWkm39kI60W7KhhFc6DwZnzx dXu2g+R9doXENT0A/mqd36HI/I4IIrU94O2F0HXjhXuJlL38b3+Fwl+SsBl2RKyj+I/m hxwtE7BBRAOx+vU/EJbhdEmWTIlfCQ3NHbSgNHliTlqTUrWbUjIAO2TnGB+duI01tYLK K71Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id wv13-20020a170907080d00b0073d68a709b1si4693786ejb.170.2022.08.28.04.10.14 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 04:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C1F5385482A for <ouuuleilei@gmail.com>; Sun, 28 Aug 2022 11:09:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTPS id 957DE3858C53 for <gcc-patches@gcc.gnu.org>; Sun, 28 Aug 2022 11:09:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 957DE3858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id A659041FC2; Sun, 28 Aug 2022 13:09:25 +0200 (CEST) Date: Sun, 28 Aug 2022 13:09:25 +0200 From: Jan-Benedict Glaw <jbglaw@lug-owl.de> To: Tom de Vries <tdevries@suse.de>, gcc-patches@gcc.gnu.org Subject: [PATCH] nvptx: Silence unused variable warning Message-ID: <20220828110925.gxuejmyvilvqy66h@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mlxjjypoyedckqu2" Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.14.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742403026089288964?= X-GMAIL-MSGID: =?utf-8?q?1742403026089288964?= |
Series |
nvptx: Silence unused variable warning
|
|
Commit Message
Jan-Benedict Glaw
Aug. 28, 2022, 11:09 a.m. UTC
Hi! The nvptx backend defines ASM_OUTPUT_DEF along with ASM_OUTPUT_DEF_FROM_DECLS. Much like the rs6000 coff target, nvptx triggers an unused variable warning: /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo ../../gcc/gcc/varasm.cc ../../gcc/gcc/varasm.cc: In function 'void output_constant_pool_contents(rtx_constant_pool*)': ../../gcc/gcc/varasm.cc:4318:21: error: unused variable 'name' [-Werror=unused-variable] 4318 | const char *name = XSTR (desc->sym, 0); | ^~~~ cc1plus: all warnings being treated as errors make[1]: *** [Makefile:1145: varasm.o] Error 1 Fixed the same way: Ok for HEAD? Thanks, Jan-Benedict --
Comments
On 8/28/2022 5:09 AM, Jan-Benedict Glaw wrote: > Hi! > > The nvptx backend defines ASM_OUTPUT_DEF along with > ASM_OUTPUT_DEF_FROM_DECLS. Much like the rs6000 coff target, nvptx > triggers an unused variable warning: > > /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo ../../gcc/gcc/varasm.cc > ../../gcc/gcc/varasm.cc: In function 'void output_constant_pool_contents(rtx_constant_pool*)': > ../../gcc/gcc/varasm.cc:4318:21: error: unused variable 'name' [-Werror=unused-variable] > 4318 | const char *name = XSTR (desc->sym, 0); > | ^~~~ > cc1plus: all warnings being treated as errors > make[1]: *** [Makefile:1145: varasm.o] Error 1 > > > Fixed the same way: > > diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h > index ed72c253191..71297440566 100644 > --- a/gcc/config/nvptx/nvptx.h > +++ b/gcc/config/nvptx/nvptx.h > @@ -321,6 +321,9 @@ struct GTY(()) machine_function > #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ > do \ > { \ > + (void) (FILE); \ > + (void) (LABEL1); \ > + (void) (LABEL2); \ > gcc_unreachable (); \ > } \ > while (0) > > > Ok for HEAD? OK with a ChangeLog entry. jeff
On 8/28/22 13:09, Jan-Benedict Glaw wrote: > Hi! > > The nvptx backend defines ASM_OUTPUT_DEF along with > ASM_OUTPUT_DEF_FROM_DECLS. Much like the rs6000 coff target, nvptx > triggers an unused variable warning: > > /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo ../../gcc/gcc/varasm.cc > ../../gcc/gcc/varasm.cc: In function 'void output_constant_pool_contents(rtx_constant_pool*)': > ../../gcc/gcc/varasm.cc:4318:21: error: unused variable 'name' [-Werror=unused-variable] > 4318 | const char *name = XSTR (desc->sym, 0); > | ^~~~ > cc1plus: all warnings being treated as errors > make[1]: *** [Makefile:1145: varasm.o] Error 1 > > > Fixed the same way: > > diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h > index ed72c253191..71297440566 100644 > --- a/gcc/config/nvptx/nvptx.h > +++ b/gcc/config/nvptx/nvptx.h > @@ -321,6 +321,9 @@ struct GTY(()) machine_function > #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ > do \ > { \ > + (void) (FILE); \ > + (void) (LABEL1); \ > + (void) (LABEL2); \ > gcc_unreachable (); \ > } \ > while (0) > > > Ok for HEAD? > LGTM. Thanks, - Tom
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index ed72c253191..71297440566 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -321,6 +321,9 @@ struct GTY(()) machine_function #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ do \ { \ + (void) (FILE); \ + (void) (LABEL1); \ + (void) (LABEL2); \ gcc_unreachable (); \ } \ while (0)