Comments
Patch
@@ -16752,7 +16752,12 @@ arm_get_frame_offsets (void)
else
for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++)
{
- if ((offsets->saved_regs_mask & (1 << i)) == 0)
+ /* While the gratuitous register save/restore is ordinarily
+ harmless, if a register is marked as fixed or global it
+ may be entirely forbidden by the system ABI to touch it,
+ so we should avoid those registers. */
+ if (!fixed_regs[i] && !global_regs[i]
+ && (offsets->saved_regs_mask & (1 << i)) == 0)
{
reg = i;
break;