]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Support (set (mem) (const_poly_int))
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Mon, 24 Oct 2022 02:03:12 +0000 (10:03 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 24 Oct 2022 02:31:06 +0000 (10:31 +0800)
gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_legitimize_move): Support (set (mem) (const_poly_int)).

gcc/config/riscv/riscv.cc

index 90a39047dd7644bca4a83a229a369d4594e24d46..53a91a1003b90dd2557738d4d1b57d6e80eff2bb 100644 (file)
@@ -1958,6 +1958,18 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx src)
 {
   if (CONST_POLY_INT_P (src))
     {
+      /*
+       Handle:
+         (insn 183 182 184 6 (set (mem:QI (plus:DI (reg/f:DI 156)
+                 (const_int 96 [0x60])) [0  S1 A8])
+         (const_poly_int:QI [8, 8]))
+       "../../../../riscv-gcc/libgcc/unwind-dw2.c":1579:3 -1 (nil))
+      */
+      if (MEM_P (dest))
+       {
+         emit_move_insn (dest, force_reg (mode, src));
+         return true;
+       }
       poly_int64 value = rtx_to_poly_int64 (src);
       if (!value.is_constant () && !TARGET_VECTOR)
        {