[PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment

Andrew_Pinski@PlayStation.Sony.Com Andrew_Pinski@PlayStation.Sony.Com
Wed Oct 10 00:38:00 GMT 2007


"H.J. Lu" <hjl@lucon.org> wrote on 10/09/2007 05:31:30 PM:

> This patch doesn't solve the stack alignment problem on x86 where gcc
> assumes the stack is 16byte aligned and ia32 psABI only specifies 4
> byte alignment. To make gcc to conform ia32 psABI, we need to
> align the stack when >4 byte alignment is needed for local variable
> as well as register spill. If we align the stack, this patch isn't
> needed for x86.

Again how many times do I have to mention, the proposal above does not 
help out when you need a bigger alignment than what is required than 
16byte alignment.  If you take a look at the testcases which are added, 
you will notice that I am testing for 256byte alignment.  For the Cell, we 
need 128byte alignment for the DMA transfers between the PowerPC and the 
SPUs.  This patch is designed to fix that case and not really any other 
case.  If you want to fix a different case, then go ahead fix that case a 
different way, this patch will be still needed to fix the case where you 
need a "big" alignment.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list