http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58545
Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amylaar at gcc dot gnu.org --- Comment #3 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> --- Instruction 37 is generated by save_call_clobbered_regs. When the eliminable registers were initialized, the frame size was zero, and the frame pointer could be eliminated. The frame size grew when the save area for r20 was allocated, but reload does not update the eliminable registers in this case. Therefore, the frame pointer r28 was eliminated to the stack pointer in insn 37. Thus, finding reloads and spilling finished with insn 37 using the stack pointer and needing a POINTER_REGS reload. Then, before it comes to selecting the reload registers, the eliminables are updated, but not the reloads that depend on them. Thus, we try - unnecessarily - to reload the frame pointer, and can't because r28 is in use as the frame pointer.