Re: [RFC] Dynamically aligning the stack

2015-04-21 Thread H.J. Lu
On Tue, Apr 21, 2015 at 9:52 AM, Steve Ellcey wrote: > On Tue, 2015-04-14 at 10:08 -0700, H.J. Lu wrote: > >> We have done just that in GCC 4.4 to implement dynamic stack >> alignment on x86 :-). Some of x86 backend changes for dynamic >> stack alignment are x86 psABI specific. Others are histor

Re: [RFC] Dynamically aligning the stack

2015-04-21 Thread Steve Ellcey
On Tue, 2015-04-14 at 10:08 -0700, H.J. Lu wrote: > We have done just that in GCC 4.4 to implement dynamic stack > alignment on x86 :-). Some of x86 backend changes for dynamic > stack alignment are x86 psABI specific. Others are historical, > like -mstackrealign. which was the old attempt for d

Re: [RFC] Dynamically aligning the stack

2015-04-14 Thread H.J. Lu
On Tue, Apr 14, 2015 at 9:58 AM, Jeff Law wrote: > On 04/14/2015 10:30 AM, Steve Ellcey wrote: >> >> 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

Re: [RFC] Dynamically aligning the stack

2015-04-14 Thread Jeff Law
On 04/14/2015 10:30 AM, Steve Ellcey wrote: 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.

Re: [RFC] Dynamically aligning the stack

2015-04-14 Thread H.J. Lu
On Tue, Apr 14, 2015 at 9:30 AM, Steve Ellcey wrote: > >> > 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

Re: [RFC] Dynamically aligning the stack

2015-04-14 Thread Steve Ellcey
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

Re: [RFC] Dynamically aligning the stack

2015-04-13 Thread Jeff Law
On 03/26/2015 05:28 PM, Steve Ellcey wrote: The issue that I am trying to address is MSA registers on MIPS. The O32 MIPS ABI specifies an 8 byte aligned stack but MSA registers should be 16 byte aligned when spilled to memory. I don't see anyway to do this unless we can force the stack to be 1

Re: [RFC] Dynamically aligning the stack

2015-03-29 Thread Mike Stump
On Mar 26, 2015, at 4:28 PM, Steve Ellcey wrote: > I am looking at ways of dynamically realigning the runtime stack in GCC. Ick, sorry to hear it. The best approach is to just tell the powers that be that an abi roll is the best, cheapest and most reliable way to fix it. [ ducks ]

[RFC] Dynamically aligning the stack

2015-03-26 Thread Steve Ellcey
I am looking at ways of dynamically realigning the runtime stack in GCC. Currently it looks like x86 is the only architecture that supports this. The issue that I am trying to address is MSA registers on MIPS. The O32 MIPS ABI specifies an 8 byte aligned stack but MSA registers should be 16 byte