https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119174
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jeffrey A. Law from comment #11) > Andrew. You're missing the point. This scenario isn't the kind of thing > that reload and LRA are supposed to fix. They fix constraint problems. ie, > I got the wrong kind of register (wrong register file), or I can't really > handlea constant, so reload the value into a register, etc. > > We have a pseudo live across a call and IRA allocates that pseudo to a call > clobbered hard register. That's an IRA bug in my book. Then it is wrong even for aarch64 which allocates r1 to the pseduo case: Popping a3(r109,l0) -- assign reg 1 I am trying to point out that it looks like LRA can fix this up (reload can do it too in some but not all cases as shown by this bug). I do think it is wrong at least for a missed optimization case where we need now to spill the register to the stack across the call. I see -fno-caller-saves fixes it too.