https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119174
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #7) > Commenting out TARGET_LRA_P in msp430.cc and gets us code that works: > ``` > .L2: > CMP.W R9, R10 { JL .L3 > ; start of epilogue > ADD.W #2, R1 > POPM.W #2, r10 > RET > .L3: > MOV.W @R13+, R14 > MOV.W R13, @R1 > CALL R14 > ADD.W #1, R10 > MOV.W @R1, R13 > BR #.L2 > > ``` > > Not the best code as it should have been in R1 in the first place but code > that definitely works. Wait `MOV.W R13, @R1` is a store and `MOV.W @R1, R13` is also a store. so my comment about being in R1 is incorrect but that is definitely doing the right thing and spilling it into a stack location across the call.