On 12/17/25 11:42 AM, Alexandre Oliva wrote:
When trying to convert the SH port to use LRA, the first issue I hit
was the need for dealing with former scratch registers at places we
didn't need to on other ports, treating them like unused output
reloads instead of rejecting them.
I contributed this through the PR a long time ago, but then I got
sidetracked. This patch wasn't enough to bring SH to a working state
with LRA, and I haven't been able to keep track of progress there, but
Oleg asked me to contribute it, so here it is. Regstrapped on
x86_64-linux-gnu. Ok to install?
I think LRA live analysis adds unused notes for pseudos created from
scratches. Unfortunately, it is done only after constraint sub-pass but
we need them right in this sub-pass.
So the patch has sense. You can commit it into the trunk. Thank you
for the patch, Alex.
for gcc/ChangeLog
PR target/55212
* lra-constraints.cc (match_reload): Treat former scratch
regs as implicit unused output reloads.
(process_alt_operands): Likewise.
(curr_insn_transform): Likewise.