aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-04-25 11:51:09 +0930
committerAlan Modra <amodra@gcc.gnu.org>2012-04-25 11:51:09 +0930
commit1bf7c2a71c1de08df6772d0d9f4b2e0d357f0e11 (patch)
tree9e7a9bd06f45fa65e01dbc392641c3def582637f /gcc
parentc344e2656abaa01b2afaebb6beef66b90433fbfa (diff)
downloadgcc-1bf7c2a71c1de08df6772d0d9f4b2e0d357f0e11.zip
gcc-1bf7c2a71c1de08df6772d0d9f4b2e0d357f0e11.tar.gz
gcc-1bf7c2a71c1de08df6772d0d9f4b2e0d357f0e11.tar.bz2
rs6000.c (rs6000_savres_strategy): Allow out-of-line save/restore for large frames.
* config/rs6000/rs6000.c (rs6000_savres_strategy): Allow out-of-line save/restore for large frames. Don't disable out-of-line saves on ABI_AIX when using static chain reg. (rs6000_emit_prologue): Adjust cr_save_regno on ABI_AIX to not clobber static chain reg, and tweak for out-of-line gpr saves that use r1. From-SVN: r186799
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/rs6000/rs6000.c17
2 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f73814..8926b3f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2012-04-25 Alan Modra <amodra@gmail.com>
+ * config/rs6000/rs6000.c (rs6000_savres_strategy): Allow
+ out-of-line save/restore for large frames. Don't disable
+ out-of-line saves on ABI_AIX when using static chain reg.
+ (rs6000_emit_prologue): Adjust cr_save_regno on ABI_AIX to not
+ clobber static chain reg, and tweak for out-of-line gpr saves
+ that use r1.
+
+2012-04-25 Alan Modra <amodra@gmail.com>
+
* config/rs6000/rs6000.c (START_USE, END_USE, NOT_INUSE): Define.
(rs6000_emit_prologue): Use the above to catch register overlap.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index bb1a2b9..31c6711 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -17432,8 +17432,7 @@ rs6000_savres_strategy (rs6000_stack_t *info,
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,8 +17453,8 @@ rs6000_savres_strategy (rs6000_stack_t *info,
/* 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)
+ 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 | REST_INLINE_FPRS)
| SAVE_INLINE_GPRS);
@@ -19555,11 +19554,17 @@ rs6000_emit_prologue (void)
}
}
- /* If we need to save CR, put it into r12 or r11. */
+ /* If we need to save CR, put it into r12 or r11. Choose r12 except when
+ r12 will be needed by out-of-line gpr restore. */
+ cr_save_regno = (DEFAULT_ABI == ABI_AIX
+ && !(strategy & (SAVE_INLINE_GPRS
+ | SAVE_NOINLINE_GPRS_SAVES_LR))
+ ? 11 : 12);
cr_save_regno = DEFAULT_ABI == ABI_AIX && !saving_GPRs_inline ? 11 : 12;
if (!WORLD_SAVE_P (info)
&& info->cr_save_p
- && REGNO (frame_reg_rtx) != cr_save_regno)
+ && REGNO (frame_reg_rtx) != cr_save_regno
+ && !(using_static_chain_p && cr_save_regno == 11))
{
rtx set;