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 17BFB3858D32 for ; Mon, 5 Sep 2022 10:43:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17BFB3858D32 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 014E84200A; Mon, 5 Sep 2022 12:43:12 +0200 (CEST) Date: Mon, 5 Sep 2022 12:43:12 +0200 From: Jan-Benedict Glaw To: "Jose E. Marchesi" Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] bpf: Fix unused variable warning Message-ID: <20220905104312.xq3dkytz5olm56up@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ftercelec7mzw4em" 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.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,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: --ftercelec7mzw4em Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Building for for bpf-unknown-none target, recent GCCs will issue an unused variable warning as the REGNO_REG_CLASS macro doesn't actually use its argument. Reference the argument as (void) to silence the warning. =2E../gcc/configure --prefix=3D... --enable-werror-always --enable-language= s=3Dall --disable-gcov --disable-shared --disable-threads --target=3Dbpf-un= known-none --without-headers [...] make V=3D1 all-gcc [...] /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 regcprop.o -MT regcprop.o -MMD -MP -MF ./.deps/regcprop.TPo ../= =2E./gcc/gcc/regcprop.cc =2E./../gcc/gcc/regcprop.cc: In function 'bool copyprop_hardreg_forward_1(b= asic_block, value_data*)': =2E./../gcc/gcc/regcprop.cc:794:24: error: unused variable 'regno' [-Werror= =3Dunused-variable] 794 | unsigned int regno =3D REGNO (SET_SRC (set)); | ^~~~~ cc1plus: all warnings being treated as errors make[1]: *** [Makefile:1146: regcprop.o] Error 1 make[1]: Leaving directory '/var/lib/laminar/run/gcc-bpf-unknown-none/1/too= lchain-build/gcc' make: *** [Makefile:4565: all-gcc] Error 2 Ok for HEAD? Thanks, Jan-Benedict gcc/ * config/bpf/bpf.h (REGNO_REG_CLASS): Reference arguments as (void). diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h index 5b3f4a58763..57903477a4a 100644 --- a/gcc/config/bpf/bpf.h +++ b/gcc/config/bpf/bpf.h @@ -209,7 +209,7 @@ enum reg_class register REGNO. In general there is more that one such class; choose a class which is "minimal", meaning that no smaller class also contains the register. */ -#define REGNO_REG_CLASS(REGNO) GENERAL_REGS +#define REGNO_REG_CLASS(REGNO) ((void)(REGNO), GENERAL_REGS) =20 /* A macro whose definition is the name of the class to which a valid base register must belong. A base register is one used in --=20 --ftercelec7mzw4em Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCYxXSwAAKCRAdvV51g5nh u1QiAJ9xVu6f0QUPj9NlxuT8tQvkVBnYIQCgh10Gq/HamI23OEVCuvhE2NmURGY= =8KNk -----END PGP SIGNATURE----- --ftercelec7mzw4em--