]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR122215, IRA]: Fix undefined behaviour of improve_allocation
authorVladimir N. Makarov <vmakarov@redhat.com>
Fri, 5 Dec 2025 19:21:38 +0000 (14:21 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 5 Dec 2025 19:29:08 +0000 (14:29 -0500)
commit2b83c489ca8ac24b3fb8b1214ec83f85f9beeedb
tree20c1c28391686db40b2fc7b1f2216ee5120e73b6
parentee9ded19244ab887759eb3faef452ee70316835e
[PR122215, IRA]: Fix undefined behaviour of improve_allocation

Register filters are used in one loop of improve_allocation to ignore some
hard regs for cost calculation but it is missed in the subsequent loop
using the costs.  This results in usage of random (undefined) register costs
and in sporadic code generation for riscv32 which uses the filters.

gcc/ChangeLog:

PR rtl-optimization/122215
* ira-color.cc (improve_allocation): Use register filter for all
loop on hard regs.

gcc/testsuite/ChangeLog:

PR rtl-optimization/122215
* gcc.target/riscv/pr122215.c: New.
* lib/target-supports.exp (check_effective_target_valgrind): New.
gcc/ira-color.cc
gcc/testsuite/gcc.target/riscv/pr122215.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp