aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-06-05 11:29:14 +0930
committerAlan Modra <amodra@gcc.gnu.org>2012-06-05 11:29:14 +0930
commit46f714c86256879a829a25536444f9119e1fb4b1 (patch)
tree811e5d4b6e4a48e291710ee16616cdb9711dd7b8 /gcc/config
parent6d1f6affb2d7c14f6c74d4a15be7e39de601bb85 (diff)
downloadgcc-46f714c86256879a829a25536444f9119e1fb4b1.zip
gcc-46f714c86256879a829a25536444f9119e1fb4b1.tar.gz
gcc-46f714c86256879a829a25536444f9119e1fb4b1.tar.bz2
rs6000.c (ptr_regno_for_savres): Comment.
gcc/ * config/rs6000/rs6000.c (ptr_regno_for_savres): Comment. (rs6000_emit_prologue): Ensure register used for inline saves of vector regs is not the static chain register. Revise comment. gcc/testsuite/ * gcc.target/powerpc/savres.c: Add -mdynamic-no-pic for darwin. Check static chain in nested funcs. From-SVN: r188225
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5796e4a..7b6e1e0 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -19109,6 +19109,9 @@ rs6000_emit_stack_reset (rs6000_stack_t *info,
return NULL_RTX;
}
+/* Return the register number used as a pointer by out-of-line
+ save/restore functions. */
+
static inline unsigned
ptr_regno_for_savres (int sel)
{
@@ -19846,6 +19849,9 @@ rs6000_emit_prologue (void)
int sel = SAVRES_SAVE | SAVRES_VR;
unsigned ptr_regno = ptr_regno_for_savres (sel);
+ if (using_static_chain_p
+ && ptr_regno == STATIC_CHAIN_REGNUM)
+ ptr_regno = 12;
if (REGNO (frame_reg_rtx) != ptr_regno)
START_USE (ptr_regno);
ptr_reg = gen_rtx_REG (Pmode, ptr_regno);
@@ -19954,9 +19960,9 @@ rs6000_emit_prologue (void)
int offset;
int save_regno;
- /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
- as frame_reg_rtx and r11 as the static chain pointer for
- nested functions. */
+ /* Get VRSAVE onto a GPR. Note that ABI_V4 and ABI_DARWIN might
+ be using r12 as frame_reg_rtx and r11 as the static chain
+ pointer for nested functions. */
save_regno = 12;
if (DEFAULT_ABI == ABI_AIX && !using_static_chain_p)
save_regno = 11;