This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] RISC-V: Fix rtl checking enabled failure with -msave-restore.
- From: Jim Wilson <jimw at sifive dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jim Wilson <jimw at sifive dot com>
- Date: Tue, 21 Jan 2020 15:22:17 -0800
- Subject: [PATCH] RISC-V: Fix rtl checking enabled failure with -msave-restore.
Found with an rtl checking enabled build and check. This triggered failures
in the gcc.target/riscv/save-restore* tests. We are using XINT to access an
XWINT value; INTVAL is the preferred solution.
Since existing tests trigger it we don't need a new one. Tested with
riscv32-elf and riscv64-linux cross builds and checks with no regressions.
Committed.
Jim
gcc/
* config/riscv/riscv-sr.c (riscv_sr_match_prologue): Use INTVAL
instead of XINT.
---
gcc/config/riscv/riscv-sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/riscv/riscv-sr.c b/gcc/config/riscv/riscv-sr.c
index e3180efcbcc..744d0c48c33 100644
--- a/gcc/config/riscv/riscv-sr.c
+++ b/gcc/config/riscv/riscv-sr.c
@@ -115,7 +115,7 @@ riscv_sr_match_prologue (rtx_insn **body)
&& GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == UNSPEC_VOLATILE
&& (GET_CODE (XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 0))
== CONST_INT)
- && XINT (XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 0), 0) == 2)
+ && INTVAL (XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 0)) == 2)
return insn;
return NULL;
--
2.17.1