RISC-V: Fix rtl checking enabled failure with -msave-restore.
authorJim Wilson <jimw@sifive.com>
Tue, 21 Jan 2020 23:20:19 +0000 (15:20 -0800)
committerJim Wilson <jimw@sifive.com>
Tue, 21 Jan 2020 23:20:19 +0000 (15:20 -0800)
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
gcc/config/riscv/riscv-sr.c

index 1763fe0..2f6e603 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-21  Jim Wilson  <jimw@sifive.com>
+
+       * config/riscv/riscv-sr.c (riscv_sr_match_prologue): Use INTVAL
+       instead of XINT.
+
 2020-01-21  H.J. Lu  <hongjiu.lu@intel.com>
            Uros Bizjak    <ubizjak@gmail.com>
 
index e3180ef..744d0c4 100644 (file)
@@ -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;