]> git.ipfire.org Git - thirdparty/gcc.git/commit
Make the RTL frontend set REG_NREGS correctly
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 21 Jul 2025 14:41:02 +0000 (15:41 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 21 Jul 2025 14:41:02 +0000 (15:41 +0100)
commitabacc79405dfd8a5148f5a79397574ebae74c2d3
tree144fda6291151f337476edd589e1ee13d4431df9
parent0b6038c17cabdbc8b9bfd0d13e2dd6f74db78734
Make the RTL frontend set REG_NREGS correctly

While working on a new testcase that uses the RTL frontend,
I hit a bug where a (reg ...) that spans multiple hard registers
had REG_NREGS set to 1.  This caused various things to misbehave.
For example, if the (reg ...) in question was used as crtl->return_rtx,
only the first register in the group would be marked as live on exit.

gcc/
* read-rtl-function.cc (function_reader::read_rtx_operand_r): Use
hard_regno_nregs to work out REG_NREGS for hard registers.

(cherry picked from commit 76db38d811a63a603deedfe327d5e201fc820444)
gcc/read-rtl-function.cc