diff mbox

[rs6000] fix PR 30282, load from stack moved past stack update

Message ID 20111104134340.GD22298@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Nov. 4, 2011, 1:43 p.m. UTC
This patch fixes PR30282, caused by instructions being scheduled over
the stack reset.  Note that only for ABI_V4 do we currently have
frame_reg_rtx != sp_reg_rtx in rs6000_emit_stack_reset, so the patch
doesn't emit *less* blockages.  I did benchmark this change and saw
nothing but the usual benchmake noise.

Bootstrapped etc. powerpc-linux.  OK to apply?

	* config/rs6000/rs6000.c (rs6000_emit_stack_reset): Always emit
	blockage for ABI_V4.

Comments

David Edelsohn Nov. 6, 2011, 4:57 p.m. UTC | #1
On Fri, Nov 4, 2011 at 9:43 AM, Alan Modra <amodra@gmail.com> wrote:
> This patch fixes PR30282, caused by instructions being scheduled over
> the stack reset.  Note that only for ABI_V4 do we currently have
> frame_reg_rtx != sp_reg_rtx in rs6000_emit_stack_reset, so the patch
> doesn't emit *less* blockages.  I did benchmark this change and saw
> nothing but the usual benchmake noise.
>
> Bootstrapped etc. powerpc-linux.  OK to apply?
>
>        * config/rs6000/rs6000.c (rs6000_emit_stack_reset): Always emit
>        blockage for ABI_V4.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 177309)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -19689,7 +19689,7 @@  rs6000_emit_stack_reset (rs6000_stack_t 
 {
   /* This blockage is needed so that sched doesn't decide to move
      the sp change before the register restores.  */
-  if (frame_reg_rtx != sp_reg_rtx
+  if (DEFAULT_ABI == ABI_V4
       || (TARGET_SPE_ABI
 	  && info->spe_64bit_regs_used != 0
 	  && info->first_gp_reg_save != 32))