From 0501b74264e93bf9ebf45cf10a624a549dc474f1 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 21 Jan 2020 15:20:19 -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. gcc/ * config/riscv/riscv-sr.c (riscv_sr_match_prologue): Use INTVAL instead of XINT. --- gcc/ChangeLog | 5 +++++ gcc/config/riscv/riscv-sr.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1763fe0..2f6e603 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-01-21 Jim Wilson + + * config/riscv/riscv-sr.c (riscv_sr_match_prologue): Use INTVAL + instead of XINT. + 2020-01-21 H.J. Lu Uros Bizjak diff --git a/gcc/config/riscv/riscv-sr.c b/gcc/config/riscv/riscv-sr.c index e3180ef..744d0c4 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.7.4