aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-06 20:06:07 -0700
committerMike Frysinger <vapier@gentoo.org>2023-12-07 21:41:27 -0700
commit4125d6473842ec85797bde679421f980103f45c5 (patch)
tree3013b08014915600f2c569edfcd43a0c132da3cb /sim
parentee45e43358fdd19cbf061f813c8c544c5e225606 (diff)
downloadfsf-binutils-gdb-4125d6473842ec85797bde679421f980103f45c5.zip
fsf-binutils-gdb-4125d6473842ec85797bde679421f980103f45c5.tar.gz
fsf-binutils-gdb-4125d6473842ec85797bde679421f980103f45c5.tar.bz2
sim: cris: fix -Wunused-but-set-variable warnings
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.
Diffstat (limited to 'sim')
-rw-r--r--sim/Makefile.in2
-rw-r--r--sim/cris/local.mk4
-rw-r--r--sim/cris/sim-if.c7
3 files changed, 9 insertions, 4 deletions
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 7fa32b8..52dd838 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -2153,6 +2153,8 @@ testsuite_common_CPPFLAGS = \
@SIM_ENABLE_ARCH_cr16_TRUE@cr16_gencode_SOURCES = cr16/gencode.c
@SIM_ENABLE_ARCH_cr16_TRUE@cr16_gencode_LDADD = cr16/cr16-opc.o
+@SIM_ENABLE_ARCH_cris_TRUE@AM_CFLAGS_cris_mloopv10f.o = -Wno-unused-but-set-variable
+@SIM_ENABLE_ARCH_cris_TRUE@AM_CFLAGS_cris_mloopv32f.o = -Wno-unused-but-set-variable
@SIM_ENABLE_ARCH_cris_TRUE@nodist_cris_libsim_a_SOURCES = \
@SIM_ENABLE_ARCH_cris_TRUE@ cris/modules.c
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 12fa86b..66ebc99 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 cad7169..12baafb 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. */