gcc: On rs6000 update sp_offset depending only on size.

This fixes a nasty bug introduced in r258651.

Reported and tested by:	Justin Hibbits
Obtained from:		gcc pre-4.3 (rev. 125116; GPLv2)
MFC after:		2 weeks
This commit is contained in:
Pedro F. Giffuni 2013-12-04 21:17:39 +00:00
parent 11f7d10cc7
commit 0a56d1d88d
2 changed files with 20 additions and 4 deletions

View File

@ -51,12 +51,20 @@
* doc/extend.texi: Document the 0b-prefixed binary integer
constant extension.
2007-05-31 Eric Christopher <echristo@apple.com>
2007-05-31 Eric Christopher <echristo@apple.com> (r125246)
* expr.c (convert_move): Assert that we don't have a BLKmode
operand.
(store_expr): Handle BLKmode moves by calling emit_block_move.
2007-05-27 Eric Christopher <echristo@apple.com> (r125116)
* config/rs6000/rs6000.c (rs6000_emit_prologue): Update
sp_offset depending on stack size. Save r12 depending
on registers we're saving later.
(rs6000_emit_epilogue): Update sp_offset depending only
on stack size.
2007-05-24 Richard Sandiford <rsandifo@nildram.co.uk> (r125037)
* postreload-gcse.c (reg_changed_after_insn_p): New function.

View File

@ -14704,8 +14704,17 @@ rs6000_emit_prologue (void)
if (!WORLD_SAVE_P (info) && info->push_p
&& !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
{
rs6000_emit_allocate_stack (info->total_size, FALSE);
if (info->total_size < 32767)
sp_offset = info->total_size;
else
frame_reg_rtx = frame_ptr_rtx;
rs6000_emit_allocate_stack (info->total_size,
(frame_reg_rtx != sp_reg_rtx
&& ((info->altivec_size != 0)
|| (info->vrsave_mask != 0)
)));
if (frame_reg_rtx != sp_reg_rtx)
rs6000_emit_stack_tie ();
}
/* Set frame pointer, if needed. */
@ -15046,8 +15055,7 @@ rs6000_emit_epilogue (int sibcall)
}
/* Set sp_offset based on the stack push from the prologue. */
if ((DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)
&& info->total_size < 32767)
if (info->total_size < 32767)
sp_offset = info->total_size;
/* Restore AltiVec registers if needed. */