]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: THEAD: Fix ICE caused by split optimizations for XTheadFMemIdx.
authorJin Ma <jinma@linux.alibaba.com>
Thu, 11 Jan 2024 11:23:04 +0000 (19:23 +0800)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 11 Jan 2024 18:43:36 +0000 (19:43 +0100)
commitb79cd204c780ee27e240616ac07e8201b85aeb92
tree6767811af3cfec275e31a31dc08de831dc75fe82
parent46afbeb81414302829fbf10c107e5466a3cf44d7
RISC-V: THEAD: Fix ICE caused by split optimizations for XTheadFMemIdx.

Due to the premature split optimizations for XTheadFMemIdx, GPR
is allocated when reload allocates registers, resulting in the
following insn.

(insn 66 21 64 5 (set (reg:DF 14 a4 [orig:136 <retval> ] [136])
        (mem:DF (plus:SI (reg/f:SI 15 a5 [141])
                (ashift:SI (reg/v:SI 10 a0 [orig:137 i ] [137])
                    (const_int 3 [0x3]))) [0  S8 A64])) 218 {*movdf_hardfloat_rv32}
     (nil))

Since we currently do not support adjustments to th_m_mir/th_m_miu,
which will trigger ICE. So it is recommended to place the split
optimizations after reload to ensure FPR when registers are allocated.

gcc/ChangeLog:

* config/riscv/thead.md: Add limits for splits.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xtheadfmemidx-medany.c: New test.
gcc/config/riscv/thead.md
gcc/testsuite/gcc.target/riscv/xtheadfmemidx-medany.c [new file with mode: 0644]