This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFA/RFC] Stack clash mitigation 0/9


On Thu, Jul 13, 2017 at 11:28:17AM -0600, Jeff Law wrote:
> On 07/12/2017 04:44 PM, Segher Boessenkool wrote:
> > On Tue, Jul 11, 2017 at 03:19:36PM -0600, Jeff Law wrote:
> >> Examples of implicit probes include
> > 
> >>   2. ABI mandates that *sp always contain a backchain pointer (ppc)
> > 
> > In the ELFv2 ABI a backchain is not required.  GCC still always has
> > one afaik.  I'll find out more.
> Please do.  I was under the impression it was mandated by the earlier
> ABIs as well.  If it isn't, then I don't think we can depend on it for
> the older ABIs.

I checked most ABIs, and all but ELFv2 require it.  You can assume we
require it everywhere (we do assume it currently, and there is no
intention to change this).  The statement in the ABI surprised me
yesterday, sorry for panicking.

> THe code we generate for alloca was so awful it's hard to see how
> hitting each page once would matter either.  *However* I was looking at
> x86 in this case and due to potential stack realignments x86's alloca
> code might be notably worse than others for constant sizes.

There is generic code that aligns too often, too.  You might be seeing
that same thing.

> There's further improvements that could be made as well.   It ought to
> be possible to write an optimizer pass that uses some of the ideas from
> DSE and SLSR to identify explicit probes that are made redundant by
> nearby implicit probes -- this would seem most useful for the dynamic space.
> 
> The problem is we'd want to do that in gimple, but probing of the
> dynamic space happens at the gimple/rtl border.  So we'd probably want
> to make probing happen earlier to expose stuff at the gimple level.

This would just get rid of one probe per dynamic allocation, correct?
Doesn't seem worth complicating anything for.


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]