public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim: bfin: fix -Wunused-but-set-variable warnings
@ 2023-12-08 5:31 Michael Frysinger
0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2023-12-08 5:31 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ee45e43358fdd19cbf061f813c8c544c5e225606
commit ee45e43358fdd19cbf061f813c8c544c5e225606
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Dec 6 06:38:29 2023 -0700
sim: bfin: fix -Wunused-but-set-variable warnings
Diff:
---
sim/bfin/bfin-sim.c | 9 ++++++---
sim/bfin/dv-bfin_emac.c | 3 ---
sim/bfin/dv-bfin_mmu.c | 4 +---
sim/bfin/dv-bfin_pll.c | 2 --
sim/bfin/dv-bfin_rtc.c | 2 --
sim/bfin/dv-bfin_sic.c | 8 --------
sim/bfin/interp.c | 2 --
7 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index a9b8fd09220..4fa5ccc315c 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -202,16 +202,18 @@ fmtconst_str (const_forms_t cf, bs32 x, bu32 pc)
if (constant_formats[cf].reloc)
{
+#if 0
bu32 ea = (((constant_formats[cf].pcrel ? SIGNEXTEND (x, constant_formats[cf].nbits)
: x) + constant_formats[cf].offset) << constant_formats[cf].scale);
if (constant_formats[cf].pcrel)
ea += pc;
- /*if (outf->symbol_at_address_func (ea, outf) || !constant_formats[cf].exact)
+ if (outf->symbol_at_address_func (ea, outf) || !constant_formats[cf].exact)
{
outf->print_address_func (ea, outf);
return "";
}
- else*/
+ else
+#endif
{
sprintf (buf, "%#x", x);
return buf;
@@ -1592,7 +1594,8 @@ decode_macfunc (SIM_CPU *cpu, int which, int op, int h0, int h1, int src0,
if (op != 3)
{
- bu8 sgn0 = (acc >> 31) & 1;
+ /* TODO: Figure out how the 32-bit sign is used. */
+ ATTRIBUTE_UNUSED bu8 sgn0 = (acc >> 31) & 1;
bu8 sgn40 = (acc >> 39) & 1;
bu40 nosat_acc;
diff --git a/sim/bfin/dv-bfin_emac.c b/sim/bfin/dv-bfin_emac.c
index 0288b740499..1ab7cd63554 100644
--- a/sim/bfin/dv-bfin_emac.c
+++ b/sim/bfin/dv-bfin_emac.c
@@ -539,11 +539,8 @@ bfin_emac_tap_init (struct hw *me)
{
#if WITH_TUN
struct bfin_emac *emac = hw_data (me);
- const hw_unit *unit;
int flags;
- unit = hw_unit_address (me);
-
emac->tap = open ("/dev/net/tun", O_RDWR);
if (emac->tap == -1)
{
diff --git a/sim/bfin/dv-bfin_mmu.c b/sim/bfin/dv-bfin_mmu.c
index 71c7176b88b..c14e2088c1f 100644
--- a/sim/bfin/dv-bfin_mmu.c
+++ b/sim/bfin/dv-bfin_mmu.c
@@ -451,7 +451,7 @@ _mmu_check_addr (SIM_CPU *cpu, bu32 addr, bool write, bool inst, int size)
{
SIM_DESC sd = CPU_STATE (cpu);
struct bfin_mmu *mmu;
- bu32 *fault_status, *fault_addr, *mem_control, *cplb_addr, *cplb_data;
+ bu32 *mem_control, *cplb_addr, *cplb_data;
bu32 faults;
bool supv, do_excp, dag1;
int i, hits;
@@ -469,8 +469,6 @@ _mmu_check_addr (SIM_CPU *cpu, bu32 addr, bool write, bool inst, int size)
}
mmu = MMU_STATE (cpu);
- fault_status = inst ? &mmu->icplb_fault_status : &mmu->dcplb_fault_status;
- fault_addr = inst ? &mmu->icplb_fault_addr : &mmu->dcplb_fault_addr;
mem_control = inst ? &mmu->imem_control : &mmu->dmem_control;
cplb_addr = inst ? &mmu->icplb_addr[0] : &mmu->dcplb_addr[0];
cplb_data = inst ? &mmu->icplb_data[0] : &mmu->dcplb_data[0];
diff --git a/sim/bfin/dv-bfin_pll.c b/sim/bfin/dv-bfin_pll.c
index dd95013f2f4..863b07f49ec 100644
--- a/sim/bfin/dv-bfin_pll.c
+++ b/sim/bfin/dv-bfin_pll.c
@@ -56,7 +56,6 @@ bfin_pll_io_write_buffer (struct hw *me, const void *source,
bu32 mmr_off;
bu32 value;
bu16 *value16p;
- bu32 *value32p;
void *valuep;
/* Invalid access mode is higher priority than missing register. */
@@ -71,7 +70,6 @@ bfin_pll_io_write_buffer (struct hw *me, const void *source,
mmr_off = addr - pll->base;
valuep = (void *)((uintptr_t)pll + mmr_base() + mmr_off);
value16p = valuep;
- value32p = valuep;
HW_TRACE_WRITE ();
diff --git a/sim/bfin/dv-bfin_rtc.c b/sim/bfin/dv-bfin_rtc.c
index b6ae0a53771..fdb63f3a4f9 100644
--- a/sim/bfin/dv-bfin_rtc.c
+++ b/sim/bfin/dv-bfin_rtc.c
@@ -59,7 +59,6 @@ bfin_rtc_io_write_buffer (struct hw *me, const void *source,
bu32 mmr_off;
bu32 value;
bu16 *value16p;
- bu32 *value32p;
void *valuep;
/* Invalid access mode is higher priority than missing register. */
@@ -74,7 +73,6 @@ bfin_rtc_io_write_buffer (struct hw *me, const void *source,
mmr_off = addr - rtc->base;
valuep = (void *)((uintptr_t)rtc + mmr_base() + mmr_off);
value16p = valuep;
- value32p = valuep;
HW_TRACE_WRITE ();
diff --git a/sim/bfin/dv-bfin_sic.c b/sim/bfin/dv-bfin_sic.c
index 5210cf0a8ee..ac302a7f851 100644
--- a/sim/bfin/dv-bfin_sic.c
+++ b/sim/bfin/dv-bfin_sic.c
@@ -147,7 +147,6 @@ bfin_sic_52x_io_write_buffer (struct hw *me, const void *source, int space,
struct bfin_sic *sic = hw_data (me);
bu32 mmr_off;
bu32 value;
- bu16 *value16p;
bu32 *value32p;
void *valuep;
@@ -162,7 +161,6 @@ bfin_sic_52x_io_write_buffer (struct hw *me, const void *source, int space,
mmr_off = addr - sic->base;
valuep = (void *)((uintptr_t)sic + mmr_base() + mmr_off);
- value16p = valuep;
value32p = valuep;
HW_TRACE_WRITE ();
@@ -261,7 +259,6 @@ bfin_sic_537_io_write_buffer (struct hw *me, const void *source, int space,
struct bfin_sic *sic = hw_data (me);
bu32 mmr_off;
bu32 value;
- bu16 *value16p;
bu32 *value32p;
void *valuep;
@@ -276,7 +273,6 @@ bfin_sic_537_io_write_buffer (struct hw *me, const void *source, int space,
mmr_off = addr - sic->base;
valuep = (void *)((uintptr_t)sic + mmr_base() + mmr_off);
- value16p = valuep;
value32p = valuep;
HW_TRACE_WRITE ();
@@ -375,7 +371,6 @@ bfin_sic_54x_io_write_buffer (struct hw *me, const void *source, int space,
struct bfin_sic *sic = hw_data (me);
bu32 mmr_off;
bu32 value;
- bu16 *value16p;
bu32 *value32p;
void *valuep;
@@ -390,7 +385,6 @@ bfin_sic_54x_io_write_buffer (struct hw *me, const void *source, int space,
mmr_off = addr - sic->base;
valuep = (void *)((uintptr_t)sic + mmr_base() + mmr_off);
- value16p = valuep;
value32p = valuep;
HW_TRACE_WRITE ();
@@ -482,7 +476,6 @@ bfin_sic_561_io_write_buffer (struct hw *me, const void *source, int space,
struct bfin_sic *sic = hw_data (me);
bu32 mmr_off;
bu32 value;
- bu16 *value16p;
bu32 *value32p;
void *valuep;
@@ -497,7 +490,6 @@ bfin_sic_561_io_write_buffer (struct hw *me, const void *source, int space,
mmr_off = addr - sic->base;
valuep = (void *)((uintptr_t)sic + mmr_base() + mmr_off);
- value16p = valuep;
value32p = valuep;
HW_TRACE_WRITE ();
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 8ad6769fa02..9a141a88a34 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -1011,7 +1011,6 @@ bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd,
if (auxvt)
{
# define AT_PUSH(at, val) \
- auxvt_size += 8; \
sp -= 4; \
auxvt = (val); \
sim_write (sd, sp, &auxvt, 4); \
@@ -1020,7 +1019,6 @@ bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd,
sim_write (sd, sp, &auxvt, 4)
unsigned int egid = getegid (), gid = getgid ();
unsigned int euid = geteuid (), uid = getuid ();
- bu32 auxvt_size = 0;
AT_PUSH (AT_NULL, 0);
AT_PUSH (AT_SECURE, egid != gid || euid != uid);
AT_PUSH (AT_EGID, egid);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-08 5:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 5:31 [binutils-gdb] sim: bfin: fix -Wunused-but-set-variable warnings Michael Frysinger
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).