This is the mail archive of the
mailing list for the GCC project.
Re: [CFT] x64 SEH, test 2
On 08/18/2010 02:35 PM, Olivier Hainque wrote:
> Richard Henderson wrote:
>> We'll have to come up with some other mechanism to handle
>> highly aligned user data. E.g. via alloca. Which reminds me,
>> didn't the AdaCore folk contribute something along those lines
>> once upon a time?
> Hmm, we have the make_aligning_type circuitry in gigi (gcc-interface/decl.c)
> for this purpose in Ada. This triggers for alignments > BIGGEST_ALIGNMENT
> (assumes that things are fine up to that, counting on the stack realignment
> for x86).
> The general idea is to craft a record with a field whose offset expression
> derives from the record's base address.
Ah, I hadn't realized that you did it in the Ada front end.
I was thinking along the lines of adding an alignment test to the
existing variable partitioning scheme in cfgexpand.c. We'd then
squash together all partitions that require alignment larger than
we can provide with MAX_STACK_ALIGNMENT. We'd then allocate this
highly aligned partition with the alloca machinery, and set the
DECL_RTL for all affected variables so that they point into the
This scheme handles user data just fine, but does not handle any
additional alignment required by the register allocator (i.e.
vector data spills) or by outgoing function parameters.
For the specific case of x64 windows, we are already guaranteed
16-byte stack alignment, and so there should be no extra alignment
needed by either of the above. (This assumes that AVX spills are
performed with unaligned stores/loads, which is supposed to
perform well on cpus with that extension.)
However, the scheme does not require _any_ special target support,
and so there are plenty of targets that ought to be able to benefit
from being able to get highly aligned user data.