riscv: Fix warning in riscv_regno_ok_for_index_p

Message ID 20230717085915.2570743-1-christoph.muellner@vrull.eu
State Unresolved
Headers
Series riscv: Fix warning in riscv_regno_ok_for_index_p |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Christoph Müllner July 17, 2023, 8:59 a.m. UTC
  From: Christoph Müllner <christoph.muellner@vrull.eu>

The variable `regno` is currently not used in riscv_regno_ok_for_index_p(),
which triggers a compiler warning. Let's address this.

Fixes: 423604278ed5 ("riscv: Prepare backend for index registers")

Reported-by: Juzhe Zhong <juzhe.zhong@rivai.ai>
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_regno_ok_for_index_p):
	Remove parameter name from declaration of unused parameter.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
 gcc/config/riscv/riscv.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Kito Cheng July 17, 2023, 9:32 a.m. UTC | #1
pushed, thanks :)

On Mon, Jul 17, 2023 at 4:59 PM Christoph Muellner
<christoph.muellner@vrull.eu> wrote:
>
> From: Christoph Müllner <christoph.muellner@vrull.eu>
>
> The variable `regno` is currently not used in riscv_regno_ok_for_index_p(),
> which triggers a compiler warning. Let's address this.
>
> Fixes: 423604278ed5 ("riscv: Prepare backend for index registers")
>
> Reported-by: Juzhe Zhong <juzhe.zhong@rivai.ai>
> Reported-by: Andreas Schwab <schwab@linux-m68k.org>
> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv.cc (riscv_regno_ok_for_index_p):
>         Remove parameter name from declaration of unused parameter.
>
> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
> ---
>  gcc/config/riscv/riscv.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 6ed735d6983..ae3c034e76e 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -861,7 +861,7 @@ riscv_index_reg_class ()
>     but extensions might support that.  */
>
>  int
> -riscv_regno_ok_for_index_p (int regno)
> +riscv_regno_ok_for_index_p (int)
>  {
>    return 0;
>  }
> --
> 2.41.0
>
  

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 6ed735d6983..ae3c034e76e 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -861,7 +861,7 @@  riscv_index_reg_class ()
    but extensions might support that.  */
 
 int
-riscv_regno_ok_for_index_p (int regno)
+riscv_regno_ok_for_index_p (int)
 {
   return 0;
 }