we end up eliminating it, it will be removed from the live list
of each basic block by reload. */
- SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM);
+ if (! reload_completed || frame_pointer_needed)
+ {
+ SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM);
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- /* If they are different, also mark the hard frame pointer as live */
- SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM);
+ /* If they are different, also mark the hard frame pointer as live */
+ SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM);
#endif
+ }
/* Mark all global registers, and all registers used by the epilogue
as being live at the end of the function since they may be
/* Don't delete insns to set global regs. */
if ((regno < FIRST_PSEUDO_REGISTER && global_regs[regno])
/* Make sure insns to set frame pointer aren't deleted. */
- || regno == FRAME_POINTER_REGNUM
+ || (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- || regno == HARD_FRAME_POINTER_REGNUM
+ || (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Make sure insns to set arg pointer are never deleted
mem_set_list = gen_rtx_EXPR_LIST (VOIDmode, reg, mem_set_list);
if (GET_CODE (reg) == REG
- && (regno = REGNO (reg), regno != FRAME_POINTER_REGNUM)
+ && (regno = REGNO (reg), ! (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed)))
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
+ && ! (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
nothing below can be necessary, so waste no more time. */
if (regno == STACK_POINTER_REGNUM
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- || regno == HARD_FRAME_POINTER_REGNUM
+ || (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|| (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
- || regno == FRAME_POINTER_REGNUM)
+ || (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed)))
{
/* If this is a register we are going to try to eliminate,
don't mark it live here. If we are successful in
if ((GET_CODE (testreg) == PARALLEL
&& GET_MODE (testreg) == BLKmode)
|| (GET_CODE (testreg) == REG
- && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM)
+ && (regno = REGNO (testreg), ! (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed)))
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
+ && ! (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
if (regno >= FIRST_PSEUDO_REGISTER || ! global_regs[regno])
{
- /* Never add REG_DEAD notes for the FRAME_POINTER_REGNUM or the
- STACK_POINTER_REGNUM, since these are always considered to be
- live. Similarly for ARG_POINTER_REGNUM if it is fixed. */
- if (regno != FRAME_POINTER_REGNUM
+ /* Never add REG_DEAD notes for STACK_POINTER_REGNUM
+ since it's always considered to be live. Similarly
+ for FRAME_POINTER_REGNUM if a frame pointer is needed
+ and for ARG_POINTER_REGNUM if it is fixed. */
+ if (! (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == HARD_FRAME_POINTER_REGNUM)
+ && ! (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
if (regno >= FIRST_PSEUDO_REGISTER || ! global_regs[regno])
{
- /* Never add REG_DEAD notes for the FRAME_POINTER_REGNUM or the
- STACK_POINTER_REGNUM, since these are always considered to be
- live. Similarly for ARG_POINTER_REGNUM if it is fixed. */
- if (regno != FRAME_POINTER_REGNUM
+ /* Never add REG_DEAD notes for STACK_POINTER_REGNUM
+ since it's always considered to be live. Similarly
+ for FRAME_POINTER_REGNUM if a frame pointer is needed
+ and for ARG_POINTER_REGNUM if it is fixed. */
+ if (! (regno == FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == HARD_FRAME_POINTER_REGNUM)
+ && ! (regno == HARD_FRAME_POINTER_REGNUM
+ && (! reload_completed || frame_pointer_needed))
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])