[PATCH] cpu: cris: drop some unused vars

Hans-Peter Nilsson hp@axis.com
Tue Dec 19 03:09:04 GMT 2023


> 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


More information about the Binutils mailing list