On 7/3/25 5:19 PM, Vineet Gupta wrote:
Provide a fallback alternaive register contraint for LRA in the light of
the tightened "Q" constraint. Cures the following ICE ...
| gcc/testsuite/gcc.target/riscv/pr118241-b.cc:31:19: error: unable to generate
reloads for:
| 31 | void m() { a.l(); }
| | ^
|(insn 26 25 27 7 (prefetch (mem/f:DI (plus:DI (reg/f:DI 143 [ _5 ])
| (const_int 56 [0x38])) [5 _5->batch[6]+0 S8 A64])
| (const_int 0 [0])
| (const_int 3 [0x3]))
"gcc/testsuite/gcc.target/riscv/pr118241-b.cc":18:29 498 {prefetch}
| (expr_list:REG_DEAD (reg/f:DI 142 [ _5->batch[6] ])
| (nil)))
|during RTL pass: reload
PR target/118241
gcc/ChangeLog:
* config/riscv/riscv.md (prefetch): Add alternative "r".
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr118241-b.cc: New test.
Hmm. I'm a little surprised that's needed. But there's new rules in
the era of LRA and define_constraint.
Note that you could have just used "Qr" as the constraint for the first
operand rather than using a multi-alternative constraint. I don't think
it hurts anything though.
OK.
jeff