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(-) > > > > 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 = -lm > > > > SIM_EXTRA_CLEAN = or1k-clean > > > > -# Code doesn't build cleanly yet. > > -SIM_WERROR_CFLAGS = > > - > > make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/or1k' > ccache gcc -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_ADDRESS_BITSIZE=32 -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -Werror -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/binutils-gdb/sim/or1k/../../include -I../../bfd -I/home/simark/src/binutils-gdb/sim/or1k/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/or1k/../../opcodes -I../.. -I/home/simark/src/binutils-gdb/sim/or1k/../../gnulib/import -I../../gnulib/import -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always -c -o mloop.o -MT mloop.o -MMD -MP -MF .deps/mloop.Tpo mloop.c > mloop.c:65:1: error: ‘or1k32bf_emit_after’ defined but not used [-Werror=unused-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. (ノ°Д°)ノ︵ ᴚƎᴎI⅂ᴎI -mike From 187a6c67c927087f791b420ed599d4003b9ac530 Mon Sep 17 00:00:00 2001 From: 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 group of parallel insns. */ -static INLINE void +ATTRIBUTE_UNUSED static INLINE void @prefix@_emit_before (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc, int first_p) { ARGBUF *abuf = &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. */ -static INLINE void +ATTRIBUTE_UNUSED static INLINE void @prefix@_emit_after (SIM_CPU *current_cpu, SCACHE *sc, PCADDR pc) { ARGBUF *abuf = &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 insn, ARGBUF *abuf, return id; } -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; -- 2.33.0