On Thu, Jul 13, 2017 at 10:35:55PM -0600, Jeff Law wrote:
> >> There's -fstack-check and -fstack-clash-protection.  I think with the
> >> direction we're going they are fundamentally incompatible because
> >> neither the compiler nor kernel do anything to guarantee enough stack is
> >> available after hitting the guard for -fstack-clash-protection.
> > 
> > Hrm, I have to think about that.
> Even if the kernel implements the reserved page stuff mentioned earlier
> in the thread, I'm not sure when we'd be able to reliably depend on that
> capability (or even check for it).
> 
> ISTM that -fstack-check continues to be Ada centric and we have a new
> option to deal with stack-clash protection and the two simply just
> aren't allowed to be enabled together.

So this essentially means Ada programs cannot get stack clash protection
at all?  And if -fstack-check is really only useful for Ada, we shouldn't
mix up that option with the stack clash thing.

> >> And there's shrink wrapping.  This was originally raised by the aarch64
> >> guys and deserves some thought.  I'm particularly worried about aarch64
> >> if it was to shrink-wrap some particular register saves that we wanted
> >> to use as an implicit probe.
> > 
> > For normal shrink-wrapping, the volatile reg stores will always happen
> > in the same prologue that sets up the stack frame as well, so there
> > won't be any problem (except the usual stack ties you might need in the
> > prologue, etc.) (*)  For separate shrink-wrapping, yeah you'll need any
> > bb that could potentially store to the stack require the component for
> > the register you use as implicit probe.  This is pretty nasty.
> I'm going to try and look at this tomorrow to get a feel for the aarch64
> implementation separate shrink wrapping.
> 
> For ppc I'm not too worried -- the implicit backchain probes are so
> effective at eliminating explicit probes that I didn't bother writing
> any code to track the register saves as implicit probes.   I'm pretty
> sure it just works on ppc with separate shrink wrapping.

With what is in trunk so far, yeah ;-)  In principle the "set up a stack
frame" part of the prologue can be made a separate shrink-wrapping
component and then we'd have to worry.  But it would be complicated to
do that and there is no real benefit I see so far, so it won't happen.
Nothing for you to have to worry about in any case :-)


Segher

Reply via email to