+2003-01-30 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_compute_initial_elimination_offset): If optimizing for
+ size, the link register is always saved if any other register is
+ saved.
+
2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Update the prototype for
reg_mask = reg_mask & ~ (reg_mask & - reg_mask);
}
- if (regs_ever_live[LR_REGNUM]
- /* If a stack frame is going to be created, the LR will
- be saved as part of that, so we do not need to allow
- for it here. */
+ if ((regs_ever_live[LR_REGNUM]
+ /* If optimizing for size, then we save the link register if
+ any other integer register is saved. This gives a smaller
+ return sequence. */
+ || (optimize_size && call_saved_registers > 0))
+ /* But if a stack frame is going to be created, the LR will
+ be saved as part of that, so we do not need to allow for
+ it here. */
&& ! frame_pointer_needed)
call_saved_registers += 4;