From: Mike Frysinger <vapier@gentoo.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/9] sim: or1k: build with -Werror
Date: Wed, 3 Nov 2021 01:19:53 -0400 [thread overview]
Message-ID: <YYIb+T/PLYHwuPna@vapier> (raw)
In-Reply-To: <4f9eafae-edc2-e835-c461-2865fd18b185@polymtl.ca>
[-- Attachment #1: Type: text/plain, Size: 4403 bytes --]
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 <vapier@gentoo.org>
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-11-03 5:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 4:59 Mike Frysinger
2021-11-01 4:59 ` [PATCH 2/9] sim: sh: reduce -Wno-error scope Mike Frysinger
2021-11-01 4:59 ` [PATCH 3/9] sim: cris: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 4/9] sim: erc32: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 5/9] sim: mips: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 6/9] sim: m32r: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 7/9] sim: frv: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 8/9] sim: lm32: " Mike Frysinger
2021-11-01 4:59 ` [PATCH 9/9] sim: iq2000: " Mike Frysinger
2021-11-03 4:09 ` [PATCH 1/9] sim: or1k: build with -Werror Simon Marchi
2021-11-03 5:19 ` Mike Frysinger [this message]
2021-11-03 14:11 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YYIb+T/PLYHwuPna@vapier \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).