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]

[CFT] Generic stack alignment for user variables


This patch implements the scheme described in

  http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01406.html

Given that no target besides x86 actually implements general
stack realignment, this fixes the problem of ignoring the alignment
requirements of a given type when it's allocated on the stack.

This only handles DECLs; it makes no attempt to align the full
stack frame.  Which is ok so long as the target does not have
machine modes (think SSE) that require super-alignment.

An obvious future direction here is to define a

  __builtin_alloca_align (size_t size, size_t align)

and have all of the VLA allocations in gimplify.c and omp-low.c
use that instead of bare __builtin_alloca.  In some cases that
should be able to eliminate some extra padding and alignment code.
In others, it will provide proper alignment for super-aligned VLAs.

It has been tested on x86_64-mingw32 (which does not have the same
stack realignment support that the rest of the x86 port does), and
alpha-linux cross.  Native testing is proceeding on ppc64, sparc64,
and ia64-linux.

That said, please review and test on your platform.


r~

Attachment: d-stackalign-1
Description: Text document


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