https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57193
Bernd Schmidt <bernds at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernds at gcc dot gnu.org --- Comment #9 from Bernd Schmidt <bernds at gcc dot gnu.org> --- It looks like the situation is as follows (X is the LRA-created reload reg) X = a op on X b = X where a and b are different registers already allocated by IRA, hence we can avoid one copy at most. I'm not very familiar with LRA yet, but I see no code to rethink such register allocation choices. -frename-registers gets rid of one unnecessary copy, it was enhanced to detect such situations for gcc-6. Maybe we should finally enable that for -O2 and higher?