From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 04/17] sim: cris: fix -Wunused-but-set-variable warnings
Date: Wed, 6 Dec 2023 20:59:24 -0700 [thread overview]
Message-ID: <20231207035937.14920-4-vapier@gentoo.org> (raw)
In-Reply-To: <20231207035937.14920-1-vapier@gentoo.org>
We suppress the warning in the generated switch file because the cris
cpu file has a hack to workaround a cgen bug, but that generates a set
but unused variable which makes the compiler upset.
---
sim/Makefile.in | 2 ++
sim/cris/local.mk | 4 ++++
sim/cris/sim-if.c | 7 +++----
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 12fa86b410d2..66ebc99376c4 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -16,6 +16,10 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
+## Some CGEN kludges are causing build-time warnings. See cris.cpu for details.
+AM_CFLAGS_%C%_mloopv10f.o = -Wno-unused-but-set-variable
+AM_CFLAGS_%C%_mloopv32f.o = -Wno-unused-but-set-variable
+
nodist_%C%_libsim_a_SOURCES = \
%D%/modules.c
%C%_libsim_a_SOURCES = \
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index cad71693ede9..12baafbf323d 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -337,7 +337,6 @@ cris_set_section_offset_iterator (bfd *abfd, asection *s, void *vp)
static void
cris_offset_sections (SIM_DESC sd, int offset)
{
- bfd_boolean ret;
struct bfd *abfd = STATE_PROG_BFD (sd);
asection *text;
struct offsetinfo oi;
@@ -350,7 +349,7 @@ cris_offset_sections (SIM_DESC sd, int offset)
oi.offset = offset;
bfd_map_over_sections (abfd, cris_set_section_offset_iterator, &oi);
- ret = bfd_set_start_address (abfd, bfd_get_start_address (abfd) + offset);
+ bfd_set_start_address (abfd, bfd_get_start_address (abfd) + offset);
STATE_START_ADDR (sd) = bfd_get_start_address (abfd);
}
@@ -516,7 +515,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
for (i = 0; i < n_hdrs; i++)
{
int interplen;
- bfd_size_type interpsiz, interp_filesiz;
+ bfd_size_type interpsiz;
struct progbounds interp_bounds;
if (phdr[i].p_type != PT_INTERP)
@@ -563,7 +562,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
perhaps should. */
interp_load_addr = 0x40000;
interpsiz = interp_bounds.endmem - interp_bounds.startmem;
- interp_filesiz = interp_bounds.end_loadmem - interp_bounds.startmem;
+ /* interp_filesiz = interp_bounds.end_loadmem - interp_bounds.startmem; */
/* If we have a non-DSO or interpreter starting at the wrong
address, bail. */
--
2.43.0
next prev parent reply other threads:[~2023-12-07 3:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 3:59 [PATCH 01/17] sim: arm: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 02/17] sim: bfin: gui: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 03/17] sim: bfin: " Mike Frysinger
2023-12-07 3:59 ` Mike Frysinger [this message]
2023-12-07 3:59 ` [PATCH 05/17] sim: d10v: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 06/17] sim: erc32: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 07/17] sim: frv: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 08/17] sim: ft32: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 09/17] sim: h8300: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 10/17] sim: m68hc11: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 11/17] sim: mcore: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 12/17] sim: mips: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 13/17] sim: mn10300: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 14/17] sim: msp430: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 15/17] sim: sh: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 16/17] sim: v850: " Mike Frysinger
2023-12-07 3:59 ` [PATCH 17/17] sim: warnings: enable -Wunused-but-set-variable Mike Frysinger
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=20231207035937.14920-4-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/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).