This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,rs6000] fix interrupt safety issue on E500 targets
On Wed, Oct 03, 2007 at 12:17:52PM -0700, Andrew Pinski wrote:
> On 10/3/07, Nathan Froyd <froydnj@codesourcery.com> wrote:
> > Any objection to simply calling rs6000_emit_stack_tie unconditionally
> > before the stack adjustment, then? (Patch below--I don't know what
> > AIX/Darwin requires here, but I can't imagine it would hurt performance
> > that much.)
> Inside rs6000_stack_info, we have the following comment:
>
> So only SVS V.4 ABI have this requirement which means PPC64-linux,
> darwin or AIX have a red zone. And yes this can worse code for OS's
> with a red zone as the main reason why the movement is happening is so
> the processor can handle the loads better.
OK, thanks for the explanation. So, modified patch below.
-Nathan
Index: rs6000.c
===================================================================
--- rs6000.c (revision 128981)
+++ rs6000.c (working copy)
@@ -16329,13 +16329,15 @@ rs6000_emit_epilogue (int sibcall)
}
}
+ /* This blockage is needed so that sched doesn't decide to move
+ the sp change before the register restores. */
+ if (DEFAULT_ABI == ABI_V4)
+ rs6000_emit_stack_tie ();
+
/* If this is V.4, unwind the stack pointer after all of the loads
have been done. */
if (frame_reg_rtx != sp_reg_rtx)
{
- /* This blockage is needed so that sched doesn't decide to move
- the sp change before the register restores. */
- rs6000_emit_stack_tie ();
if (TARGET_SPE_ABI
&& info->spe_64bit_regs_used != 0
&& info->first_gp_reg_save != 32)