]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 1763fe0631d42b524aae6fc1e134644c80fba92c..2f6e603df7a8eeb9d70f329a5037b7fdddd181c7 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 e3180efcbcca25d6995a210be0cb37527e674e09..744d0c48c333af2901fde2adb5dd09ac303ae6dd 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;