From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A54DF3857C4C for ; Wed, 3 Nov 2021 05:19:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A54DF3857C4C Received: by smtp.gentoo.org (Postfix, from userid 559) id 14041342F3C; Wed, 3 Nov 2021 05:19:55 +0000 (UTC) Date: Wed, 3 Nov 2021 01:19:53 -0400 From: Mike Frysinger To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/9] sim: or1k: build with -Werror Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20211101045945.23481-1-vapier@gentoo.org> <4f9eafae-edc2-e835-c461-2865fd18b185@polymtl.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="83STvTzmi2bYSPj3" Content-Disposition: inline In-Reply-To: <4f9eafae-edc2-e835-c461-2865fd18b185@polymtl.ca> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 05:19:57 -0000 --83STvTzmi2bYSPj3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03 Nov 2021 00:09, Simon Marchi wrote: > On 2021-11-01 00:59, Mike Frysinger via Gdb-patches wrote: > > The only warnings left in this port are a few maybe-uninitialized, > > but we don't abort the build for them, so turn on -Werror everywhere. > > --- > > sim/or1k/Makefile.in | 3 --- > > 1 file changed, 3 deletions(-) > >=20 > > diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in > > index 8f447fdc291a..c6bd03b756cd 100644 > > --- a/sim/or1k/Makefile.in > > +++ b/sim/or1k/Makefile.in > > @@ -55,9 +55,6 @@ SIM_EXTRA_LIBS =3D -lm > > =20 > > SIM_EXTRA_CLEAN =3D or1k-clean > > =20 > > -# Code doesn't build cleanly yet. > > -SIM_WERROR_CFLAGS =3D > > - >=20 > make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/or1k' > ccache gcc -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=3D32 -DWITH_TARGET= _WORD_MSB=3D31 -DWITH_TARGET_ADDRESS_BITSIZE=3D32 -DWITH_HW=3D1 -DHAVE_DV_= SOCKSER -DDEFAULT_INLINE=3D0 -Wall -Wdeclaration-after-statement -Wpointer-= arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-su= bscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=3Dmaybe-uniniti= alized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-stat= ement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -Werr= or -I. -I/home/simark/src/binutils-gdb/sim/or1k -I../common -I/home/simark= /src/binutils-gdb/sim/or1k/../common -I../../include -I/home/simark/src/bin= utils-gdb/sim/or1k/../../include -I../../bfd -I/home/simark/src/binutils-gd= b/sim/or1k/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/or= 1k/../../opcodes -I../.. -I/home/simark/src/binutils-gdb/sim/or1k/../../gn= ulib/import -I../../gnulib/import -g3 -O0 -fsanitize=3Daddress -fmax-error= s=3D1 -fdiagnostics-color=3Dalways -c -o mloop.o -MT mloop.o -MMD -MP -MF= .deps/mloop.Tpo mloop.c > mloop.c:65:1: error: =E2=80=98or1k32bf_emit_after=E2=80=99 defined but no= t used [-Werror=3Dunused-function] > 65 | or1k32bf_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc) > | ^~~~~~~~~~~~~~~~~~~ thanks for the heads up. easy to fix, but super annoying how gcc doesn't throw this error w/-O2 or anything higher than -O0. i fixed all the ones that showed up in my -O0 multibuild. (=E3=83=8E=C2=B0=D0=94=C2=B0=EF=BC=89=E3=83=8E=EF=B8=B5 =E1=B4=9A=C6=8E=E1= =B4=8EI=E2=85=82=E1=B4=8EI -mike =46rom 187a6c67c927087f791b420ed599d4003b9ac530 Mon Sep 17 00:00:00 2001 =46rom: Mike Frysinger Date: Wed, 3 Nov 2021 01:17:17 -0400 Subject: [PATCH] sim: mloop: mark a few conditionally used funcs as unused These are marked inline, so building w/gcc at higher optimization levels will automatically discard them. But building with -O0 will trigger unused function warnings, so fix that. The common before/after cover functions in the common mloop generator are not used by all architecture ports. Doesn't seem to be a hard requirement, so marking them optional (i.e. unused) is fine. The cris execute function is conditionally used depending on the fast-build mode settings, so mark it unused too. --- sim/common/genmloop.sh | 4 ++-- sim/cris/mloop.in | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh index 572dc8a9ed4b..b8a0f435a09b 100755 --- a/sim/common/genmloop.sh +++ b/sim/common/genmloop.sh @@ -349,7 +349,7 @@ static INLINE void This is as opposed to x-after which is only emitted at the end of a gro= up of parallel insns. */ =20 -static INLINE void +ATTRIBUTE_UNUSED static INLINE void @prefix@_emit_before (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc, int fir= st_p) { ARGBUF *abuf =3D &sc[0].argbuf; @@ -364,7 +364,7 @@ static INLINE void x-after is emitted after a serial insn or at the end of a group of parallel insns. */ =20 -static INLINE void +ATTRIBUTE_UNUSED static INLINE void @prefix@_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc) { ARGBUF *abuf =3D &sc[0].argbuf; diff --git a/sim/cris/mloop.in b/sim/cris/mloop.in index 645d82116069..da800e745afd 100644 --- a/sim/cris/mloop.in +++ b/sim/cris/mloop.in @@ -67,7 +67,8 @@ extract (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_INT i= nsn, ARGBUF *abuf, return id; } =20 -static INLINE SEM_PC +/* This might not be used directly depending on the fast compile mode. */ +ATTRIBUTE_UNUSED static INLINE SEM_PC execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p) { SEM_PC vpc; --=20 2.33.0 --83STvTzmi2bYSPj3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmGCG/gACgkQQWM7n+g3 9YFKDA/8DrC1LS6FuhQpzX+FeunNHLiTsYN8VY8NP8TIQC9blU6q7oydWCjHfLAB 1amzmkjHiQm6DDcDmK44MEBU6wuORAmdmNSZyAkqM7+bZeH0LuSmNDzhZDLPVYdE XTIIz6PjpDMDCORX3qxmXUxwck9+ZpvauM1s6cC3rT38Qjzu9PrAbBN91EFNyRqU BFwpIcQT1WM3VTWZrHIIdWE2dVG3C15Y1DZf2zsNjZE5FkpksPczcN6wsd7FK+le DZ2pCi+JYi5v6CDp5ub0YipeW08bDbYIVzwCiS2q3XurNfcR92QciiaV84K99r+0 SmdmqeJHEkDZ/U8POoJDqH34sUSMRwTFA3fAtVP6uMa8n5xaRnjBfDJYThqHMPZP 8KQjwDGsQDOLGovE3n3wuk/JgtAzwlSCA+ikQTT2OGDoo7QMu9RZxmMDR0k58DPg 2o58sF9cCMMlh5vCFa6LvG2/Cp/WyjIab1Xgxas3GqJuSIMOnkrhZjcpaqpQn0VH 0x1mkzmo7sOa0QOYnaFEa4JGseS2MZ8h3XDrTTYtu4nFX0N3gae6yEXm58v96K6z pTVulNabNHChamzZoGSbe9QbBolYT+uw2RTVm46NrkovSka2MwdWV5EqSJbrbelz slk+m3AbPEWYUXqdfdtozzfko953m4ezhaabZF2+7mtu0bTM930= =DJ4Z -----END PGP SIGNATURE----- --83STvTzmi2bYSPj3--