]> git.ipfire.org Git - thirdparty/gcc.git/commit
IRA: Check that reg classes contain a hard reg of given mode in reg move cost calculation
authorVladimir N. Makarov <vmakarov@redhat.com>
Thu, 15 Dec 2022 19:11:05 +0000 (14:11 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Thu, 15 Dec 2022 19:19:19 +0000 (14:19 -0500)
commit12abd5a7d13209f79664ea603b3f3517f71b8c4f
tree33ef2dedc4b7ed559a43cd0d965bdf3eefc850eb
parent8b775b4c48a3cc4ef5c50e56144aea02da2e9cc6
IRA: Check that reg classes contain a hard reg of given mode in reg move cost calculation

IRA calculates wrong AVR costs for moving general hard regs of SFmode.  To
calculate the costs we did not exclude sub-classes which do not contain
hard regs of given mode.  This was the reason for spilling a pseudo in the
PR. The patch fixes this.

        PR rtl-optimization/90706

gcc/ChangeLog:

* ira-costs.cc: Include print-rtl.h.
(record_reg_classes, scan_one_insn): Add code to print debug info.
* ira.cc (ira_init_register_move_cost): Check that at least one hard
reg of the mode are in the class contents to calculate the
register move costs.

gcc/testsuite/ChangeLog:

* gcc.target/avr/pr90706.c: New.
gcc/ira-costs.cc
gcc/ira.cc
gcc/testsuite/gcc.target/avr/pr90706.c [new file with mode: 0644]