This is the mail archive of the gcc@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]

Re: A proposal to align GCC stack


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.


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