From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTPS id 957DE3858C53 for ; 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 To: Tom de Vries , 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 List-Id: --mlxjjypoyedckqu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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_DIR= ECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -= W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribu= te -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../.= =2E/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbac= ktrace -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo ../../gcc= /gcc/varasm.cc =2E./../gcc/gcc/varasm.cc: In function 'void output_constant_pool_contents(= rtx_constant_pool*)': =2E./../gcc/gcc/varasm.cc:4318:21: error: unused variable 'name' [-Werror= =3Dunused-variable] 4318 | const char *name =3D 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? Thanks, Jan-Benedict --=20 --mlxjjypoyedckqu2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCYwtM4QAKCRAdvV51g5nh u/BHAJ43dWz7+XlHkdOTuUQqcGspybe0ywCfVbDRaPqu7v/t1oQ3KCgseFzd8AI= =5Vj1 -----END PGP SIGNATURE----- --mlxjjypoyedckqu2--