On Tue, Nov 15, 2016 at 6:48 AM, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > If we use ABI_V4 and we have a big stack frame, we end the epilogue > with a "mr 1,11" (or similar) instruction. This instruction however > has no dependencies on the earlier restores from stack (done via r11), > so sched2 can end up reordering the insns, which is bad because we > have no red zone so that you then restore from stack that is already > deallocated. > > This fixes it by making that restore depend on the memory accesses. > > Tested on powerpc64-linux {-m32,-m64}; is this okay for trunk? Do we > want a testcase for this? > > > Segher > > > 2016-11-15 Segher Boessenkool <seg...@kernel.crashing.org> > > * config/rs6000/rs6000.c (rs6000_emit_stack_reset): Emit the > stack_restore_tie insn instead of stack_tie, for the SVR4 and > SPE ABIs. > * config/rs6000/rs6000.md (stack_restore_tie): New define_insn.
Okay. A similar change may be necessary for other uses of rs6000_stack_tie in the prologue. It would be good to comment somewhere that stack_restore_tie is a superset of rs6000_stack_tie. Thanks, David