This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Dynamically aligning the stack
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 14 Apr 2015 09:30:24 -0700
- Subject: Re: [RFC] Dynamically aligning the stack
- Authentication-results: sourceware.org; auth=none
- References: <d36dff8c-c009-4767-b6d6-bec02f7cf86d at BAMAIL02 dot ba dot imgtec dot org> <552CA316 dot 7060106 at redhat dot com>
- Reply-to: <sellcey at imgtec dot com>
On Mon, 2015-04-13 at 23:18 -0600, Jeff Law wrote:
> But I don't see how using alloca ensures that you're going to have an
> aligned spill slot. It can get you an aligned stack pointer, but that
> doesn't ensure alignment of any particular spill slot IIRC.
It doesn't. I found a big hole in my idea because as soon as you do an alloca
then frame_pointer_needed is set to true and spills are done relative to
the frame pointer, not the stack pointer. Thus having an aligned stack
pointer at that point doesn't help at all with the alignment of spills.
> > My second question is what do people think about this as a way to dymanically
> > align the stack? It seems a lot simpler and more target independent than
> > what x86 is doing.
> My biggest worry is the large disconnect between where you're trying to
> solve the problem (gimple) and where the problematic bits are
> (LRA/reload). That seems like to be fragile in the long run.
>
> jeff
Yes, I am trying to look at how the x86 does dynamic stack alignment but
it is difficult to untangle the generic concepts from the parts tied
specifically to the x86 calling convention. No other platform appears
to do dynamic stack alignment.
Steve Ellcey
sellcey@imgtec.com