]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V][PR target/122106] Add missing predicate on crc expanders
authorJeff Law <jlaw@ventanamicro.com>
Wed, 1 Oct 2025 21:12:49 +0000 (15:12 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Wed, 1 Oct 2025 21:14:00 +0000 (15:14 -0600)
commitc866a8a88242833f64fe25e04e4ad4c097daec34
tree00d3c969a9a39428cddb9f78ba0731c9a04d84b7
parent88e9cc95abd8fe3a7f506f1791b08c32d36cd760
[RISC-V][PR target/122106] Add missing predicate on crc expanders

This is a minor bug in the CRC code for RISC-V.

Essentially in the expander we have an operand without a predicate.  So it
matches anything.  But that operand really has to be a CONST_INT.  So this
patch adds the missing predicate.  I noticed we had constraints on our
define_expand.  It doesn't hurt anything, but they're never used and can easily
get out of date, so this removes the unnecessary constraints.

Tested on riscv32-elf and riscv64-elf.  Bootstrap & regression test on the
Pioneer is in flight and should finish in the next few hours.

Pushing to the trunk once CI confirms it's OK.

PR target/122106
gcc/
* config/riscv/bitmanip.md (crc expanders): Add predicate for
polynomial argument.  Drop unnecessary constraints.

gcc/testsuite/

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