Commit 2882bfcc by Alan Modra Committed by Alan Modra

rs6000.c (rs6000_emit_allocate_stack): Delete unnecessary prototype.

	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete
	unnecessary prototype.  Replace copy_r12 and copy_r11 flag params
	with copy_reg rtx param.
	(rs6000_emit_prologue): Update rs6000_emit_allocate_stack calls.
	Correct cases where code for ABI_V4 did not initialise the reg
	used to access frame.  Also leave frame_reg_rtx as sp for large
	frames that save no regs.

From-SVN: r159483
parent 5feb49f0
2010-05-17 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete
unnecessary prototype. Replace copy_r12 and copy_r11 flag params
with copy_reg rtx param.
(rs6000_emit_prologue): Update rs6000_emit_allocate_stack calls.
Correct cases where code for ABI_V4 did not initialise the reg
used to access frame. Also leave frame_reg_rtx as sp for large
frames that save no regs.
2010-05-17 Martin Jambor <mjambor@suse.cz> 2010-05-17 Martin Jambor <mjambor@suse.cz>
PR middle-end/44133 PR middle-end/44133
......
...@@ -883,7 +883,6 @@ static bool spe_func_has_64bit_regs_p (void); ...@@ -883,7 +883,6 @@ static bool spe_func_has_64bit_regs_p (void);
static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int, static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int,
int, HOST_WIDE_INT); int, HOST_WIDE_INT);
static rtx gen_frame_mem_offset (enum machine_mode, rtx, int); static rtx gen_frame_mem_offset (enum machine_mode, rtx, int);
static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int, int);
static unsigned rs6000_hash_constant (rtx); static unsigned rs6000_hash_constant (rtx);
static unsigned toc_hash_function (const void *); static unsigned toc_hash_function (const void *);
static int toc_hash_eq (const void *, const void *); static int toc_hash_eq (const void *, const void *);
...@@ -18035,13 +18034,11 @@ rs6000_emit_stack_tie (void) ...@@ -18035,13 +18034,11 @@ rs6000_emit_stack_tie (void)
} }
/* Emit the correct code for allocating stack space, as insns. /* Emit the correct code for allocating stack space, as insns.
If COPY_R12, make sure a copy of the old frame is left in r12. If COPY_REG, make sure a copy of the old frame is left there.
If COPY_R11, make sure a copy of the old frame is left in r11,
in preference to r12 if COPY_R12.
The generated code may use hard register 0 as a temporary. */ The generated code may use hard register 0 as a temporary. */
static void static void
rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg)
{ {
rtx insn; rtx insn;
rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM); rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
...@@ -18084,11 +18081,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) ...@@ -18084,11 +18081,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11)
warning (0, "stack limit expression is not supported"); warning (0, "stack limit expression is not supported");
} }
if (copy_r12 || copy_r11) if (copy_reg)
emit_move_insn (copy_r11 emit_move_insn (copy_reg, stack_reg);
? gen_rtx_REG (Pmode, 11)
: gen_rtx_REG (Pmode, 12),
stack_reg);
if (size > 32767) if (size > 32767)
{ {
...@@ -18774,20 +18768,33 @@ rs6000_emit_prologue (void) ...@@ -18774,20 +18768,33 @@ rs6000_emit_prologue (void)
? (!saving_GPRs_inline ? (!saving_GPRs_inline
&& info->spe_64bit_regs_used == 0) && info->spe_64bit_regs_used == 0)
: (!saving_FPRs_inline || !saving_GPRs_inline)); : (!saving_FPRs_inline || !saving_GPRs_inline));
rtx copy_reg = need_r11 ? gen_rtx_REG (Pmode, 11) : NULL;
if (info->total_size < 32767) if (info->total_size < 32767)
sp_offset = info->total_size; sp_offset = info->total_size;
else if (need_r11)
frame_reg_rtx = copy_reg;
else if (info->cr_save_p
|| info->lr_save_p
|| info->first_fp_reg_save < 64
|| info->first_gp_reg_save < 32
|| info->altivec_size != 0
|| info->vrsave_mask != 0
|| crtl->calls_eh_return)
{
copy_reg = frame_ptr_rtx;
frame_reg_rtx = copy_reg;
}
else else
frame_reg_rtx = (need_r11 {
? gen_rtx_REG (Pmode, 11) /* The prologue won't be saving any regs so there is no need
: frame_ptr_rtx); to set up a frame register to access any frame save area.
rs6000_emit_allocate_stack (info->total_size, We also won't be using sp_offset anywhere below, but set
(frame_reg_rtx != sp_reg_rtx the correct value anyway to protect against future
&& (info->cr_save_p changes to this function. */
|| info->lr_save_p sp_offset = info->total_size;
|| info->first_fp_reg_save < 64 }
|| info->first_gp_reg_save < 32 rs6000_emit_allocate_stack (info->total_size, copy_reg);
)),
need_r11);
if (frame_reg_rtx != sp_reg_rtx) if (frame_reg_rtx != sp_reg_rtx)
rs6000_emit_stack_tie (); rs6000_emit_stack_tie ();
} }
...@@ -19222,16 +19229,19 @@ rs6000_emit_prologue (void) ...@@ -19222,16 +19229,19 @@ rs6000_emit_prologue (void)
if (!WORLD_SAVE_P (info) && info->push_p if (!WORLD_SAVE_P (info) && info->push_p
&& !(DEFAULT_ABI == ABI_V4 || crtl->calls_eh_return)) && !(DEFAULT_ABI == ABI_V4 || crtl->calls_eh_return))
{ {
rtx copy_reg = NULL;
if (info->total_size < 32767) if (info->total_size < 32767)
sp_offset = info->total_size; sp_offset = info->total_size;
else if (info->altivec_size != 0
|| info->vrsave_mask != 0)
{
copy_reg = frame_ptr_rtx;
frame_reg_rtx = copy_reg;
}
else else
frame_reg_rtx = frame_ptr_rtx; sp_offset = info->total_size;
rs6000_emit_allocate_stack (info->total_size, rs6000_emit_allocate_stack (info->total_size, copy_reg);
(frame_reg_rtx != sp_reg_rtx
&& ((info->altivec_size != 0)
|| (info->vrsave_mask != 0)
)),
FALSE);
if (frame_reg_rtx != sp_reg_rtx) if (frame_reg_rtx != sp_reg_rtx)
rs6000_emit_stack_tie (); rs6000_emit_stack_tie ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment