public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] cpu: cris: drop some unused vars
@ 2023-12-19  2:44 Mike Frysinger
  2023-12-19  3:09 ` Hans-Peter Nilsson
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2023-12-19  2:44 UTC (permalink / raw)
  To: binutils; +Cc: gdb-patches, hp

These fix unused variable warnings in the generated sim.
---
 cpu/cris.cpu                  | 4 ++--
 sim/cris/semcrisv10f-switch.c | 2 --
 sim/cris/semcrisv32f-switch.c | 2 --
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/cpu/cris.cpu b/cpu/cris.cpu
index 97b44581e78b..2e8cb352b2b9 100644
--- a/cpu/cris.cpu
+++ b/cpu/cris.cpu
@@ -2598,7 +2598,7 @@
      "move ${Ps},${Rd-sfield}"
      (+ Ps RFIX_MOVE_S_R MODE_REGISTER SIZE_FIXED Rd-sfield)
      (sequence
-       ((SI grno) (SI prno) (SI newval))
+       ((SI prno) (SI newval))
        (set prno (regno Ps))
        ; CGEN-FIXME: Can't use the following and then "grno" below because
        ; CGEN will emit a "tmp_grno" *also* in decodev32.c:crisv32f_decode
@@ -3837,7 +3837,7 @@
  "$Rs,$Rd"
  (+ Rd MODE_REGISTER RFIX_BTST SIZE_FIXED Rs)
  (sequence
-   ((SI tmpd) (SI cnt))
+   ((SI tmpd))
    (set tmpd (sll Rd (sub 31 (and Rs 31))))
    (setf-move SI tmpd))
 )
diff --git a/sim/cris/semcrisv10f-switch.c b/sim/cris/semcrisv10f-switch.c
index a2bf6f1a6305..711d3c049fd5 100644
--- a/sim/cris/semcrisv10f-switch.c
+++ b/sim/cris/semcrisv10f-switch.c
@@ -3181,7 +3181,6 @@ cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special regi
   vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
 
 {
-  SI tmp_grno;
   SI tmp_prno;
   SI tmp_newval;
   tmp_prno = FLD (f_operand2);
@@ -11777,7 +11776,6 @@ SET_H_VBIT_MOVE (0);
 
 {
   SI tmp_tmpd;
-  SI tmp_cnt;
   tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
 {
   {
diff --git a/sim/cris/semcrisv32f-switch.c b/sim/cris/semcrisv32f-switch.c
index 8dd455c94e9a..0ff3df5ac848 100644
--- a/sim/cris/semcrisv32f-switch.c
+++ b/sim/cris/semcrisv32f-switch.c
@@ -3108,7 +3108,6 @@ cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special regi
   vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
 
 {
-  SI tmp_grno;
   SI tmp_prno;
   SI tmp_newval;
   tmp_prno = FLD (f_operand2);
@@ -12047,7 +12046,6 @@ SET_H_VBIT_MOVE (0);
 
 {
   SI tmp_tmpd;
-  SI tmp_cnt;
   tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
 {
   {
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpu: cris: drop some unused vars
  2023-12-19  2:44 [PATCH] cpu: cris: drop some unused vars Mike Frysinger
@ 2023-12-19  3:09 ` Hans-Peter Nilsson
  2023-12-19 10:45   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Hans-Peter Nilsson @ 2023-12-19  3:09 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, gdb-patches

> From: Mike Frysinger <vapier@gentoo.org>
> Date: Mon, 18 Dec 2023 21:44:23 -0500

> These fix unused variable warnings in the generated sim.
> ---
>  cpu/cris.cpu                  | 4 ++--
>  sim/cris/semcrisv10f-switch.c | 2 --
>  sim/cris/semcrisv32f-switch.c | 2 --
>  3 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/cpu/cris.cpu b/cpu/cris.cpu
> index 97b44581e78b..2e8cb352b2b9 100644
> --- a/cpu/cris.cpu
> +++ b/cpu/cris.cpu
> @@ -2598,7 +2598,7 @@
>       "move ${Ps},${Rd-sfield}"
>       (+ Ps RFIX_MOVE_S_R MODE_REGISTER SIZE_FIXED Rd-sfield)
>       (sequence
> -       ((SI grno) (SI prno) (SI newval))
> +       ((SI prno) (SI newval))
>         (set prno (regno Ps))
>         ; CGEN-FIXME: Can't use the following and then "grno" below because
>         ; CGEN will emit a "tmp_grno" *also* in decodev32.c:crisv32f_decode

'k, but can you please "move" the removed declaration to the
comment?

Something like '; CGEN-FIXME: Can't declare (SI grno) and
then the following and then use "grno" below because'.  Else
it'll look even more odd with there being no "grno" at all.

If it's not obvious: IIRC, this refers to "(regno
Rd-sfield)" which would be more readable "decoded" as
"grno".  ...well, relatively more readable.

> @@ -3837,7 +3837,7 @@
>   "$Rs,$Rd"
>   (+ Rd MODE_REGISTER RFIX_BTST SIZE_FIXED Rs)
>   (sequence
> -   ((SI tmpd) (SI cnt))
> +   ((SI tmpd))

Either that, or add "(set cnt (sub 31 (and Rs 31))" with the
next line replaced by "(set tmpd (sll Rd cnt))".  At your
discretion.

No need to repost if you optionally fix those, commit at
your leisure.  Thanks!

brgds, H-P

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpu: cris: drop some unused vars
  2023-12-19  3:09 ` Hans-Peter Nilsson
@ 2023-12-19 10:45   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2023-12-19 10:45 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

thanks, i'm not a lisp person, so not easy for me to put these together.
i applied your suggestions.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-19 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19  2:44 [PATCH] cpu: cris: drop some unused vars Mike Frysinger
2023-12-19  3:09 ` Hans-Peter Nilsson
2023-12-19 10:45   ` Mike 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).