]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V][PR target/118122] Fix modes in recently added risc-v pattern
authorJeff Law <jlaw@ventanamicro.com>
Mon, 30 Dec 2024 14:40:07 +0000 (07:40 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 30 Dec 2024 14:42:54 +0000 (07:42 -0700)
commit64d31343d4676d8ceef9232dcd33824bc2eff330
treeb2bbd4022cd695c54826a5449d4ce6e3546a9425
parentea66f57c9603312a8e4117b719d55becbc28ec43
[RISC-V][PR target/118122] Fix modes in recently added risc-v pattern

The new pattern to optimize certain code sequences on RISC-V played things a
bit fast and loose with modes -- some operands were using the ALLI iterator
while the scratch used X and the split codegen used X.

Naturally under the "right" circumstances this would trigger an ICE due to
mismatched modes.  This patch uses X consistently in that pattern. It also
fixes some formatting nits.

Tested in my tester, but waiting on the pre-commit verdict before moving
forward.

PR target/118122
gcc/
* config/riscv/riscv.md (lui_constraint<X:mode>_and_to_or): Use
X iterator rather than ANYI consistently.  Fix formatting.

gcc/testsuite

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