]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V][PR target/121983] Fix unprotected REGNO invocation
authorJeff Law <jlaw@ventanamicro.com>
Fri, 19 Sep 2025 15:17:01 +0000 (09:17 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 19 Sep 2025 15:18:02 +0000 (09:18 -0600)
commitcc0959221ee2a6f17dda6335bb1615207e2c8e51
tree0a3cd91b38cc93625a5b15da20f6f5c68c6fee90
parentb71ff5184a6216bfc997ada706c89b2f585a7e66
[RISC-V][PR target/121983] Fix unprotected REGNO invocation

So this was a naked REGNO usage, which of course blows up if RTL checking is
enabled and something else sneaks in (SUBREG).   Thankfully it never results in
incorrect code, though I could theorize it could cause a bootstrap comparison
failure in the "right" circumstances.

Bootstrapped & regression tested on the Pioneer.  Also regression tested on
riscv64-elf and riscv32-elf.   I'll push to the trunk once pre-commit CI is
done.

jeff

PR target/121983
gcc/
* config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Make sure
object is a REG before asking for its REGNO.  Fix a trivial
whitespace nit.

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