Comments
Patch
@@ -17432,8 +17432,7 @@ rs6000_savres_strategy (rs6000_stack_t *
strategy |= SAVRES_MULTIPLE;
if (crtl->calls_eh_return
- || cfun->machine->ra_need_lr
- || info->total_size > 32767)
+ || cfun->machine->ra_need_lr)
strategy |= (SAVE_INLINE_FPRS | REST_INLINE_FPRS
| SAVE_INLINE_GPRS | REST_INLINE_GPRS);
@@ -17454,10 +17453,10 @@ rs6000_savres_strategy (rs6000_stack_t *
/* Don't bother to try to save things out-of-line if r11 is occupied
by the static chain. It would require too much fiddling and the
static chain is rarely used anyway. FPRs are saved w.r.t the stack
- pointer on Darwin. */
- if (using_static_chain_p)
- strategy |= (DEFAULT_ABI == ABI_DARWIN ? 0 : SAVE_INLINE_FPRS)
- | SAVE_INLINE_GPRS;
+ pointer on Darwin, and AIX uses r1 or r12. */
+ if (using_static_chain_p && DEFAULT_ABI != ABI_AIX)
+ strategy |= ((DEFAULT_ABI == ABI_DARWIN ? 0 : SAVE_INLINE_FPRS)
+ | SAVE_INLINE_GPRS);
/* If we are going to use store multiple, then don't even bother
with the out-of-line routines, since the store-multiple
@@ -19555,7 +19554,10 @@ rs6000_emit_prologue (void)
}
/* If we need to save CR, put it into r12 or r11. */
- cr_save_regno = DEFAULT_ABI == ABI_AIX && !saving_GPRs_inline ? 11 : 12;
+ cr_save_regno = (DEFAULT_ABI == ABI_AIX
+ && (strategy & SAVE_INLINE_GPRS) == 0
+ && (strategy & SAVE_NOINLINE_GPRS_SAVES_LR) == 0
+ && !using_static_chain_p ? 11 : 12);
if (!WORLD_SAVE_P (info)
&& info->cr_save_p
&& REGNO (frame_reg_rtx) != cr_save_regno)