This is the mail archive of the
mailing list for the GCC project.
Re: A proposal to align GCC stack
- From: Robert Dewar <dewar at adacore dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 18 Dec 2007 08:52:11 -0500
- Subject: Re: A proposal to align GCC stack
- References: <20071218042535.3FB1F73CC4@caffeine.csclub.uwaterloo.ca>
Ross Ridge wrote:
Ye, Joey writes:
i. STACK_BOUNDARY in bits, which is enforced by hardware, 32 for i386
and 64 for x86_64. It is the minimum stack boundary. It is fixed.
Strictly speaking by the above definition it would be 8 for i386.
The hardware doesn't force the stack to be 32-bit aligned, it just
performs poorly if it isn't.
This seems wrong to me.
First, although for some types, the accesses may work, the optimizer
is allowed to assume that data is properly aligned, and could possibly
generate incorrect code (in Ada it is formally erroneous to have any
variable that is not properly aligned to its types alignment, unless
the alignment is specficially set to some other value).
Second, I am pretty sure there are SSE types that require
alignment at the hardware levell, even on the i386.