This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: On alignment
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: Jamie Lokier <jamie at shareable dot org>
- Cc: Andreas Schwab <schwab at suse dot de>, Andrew Haley <aph at redhat dot com>, Jason Merrill <jason at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 23 Apr 2003 20:11:22 +0100
- Subject: Re: On alignment
- Organization: SuperH UK Ltd.
> For the same reason, "struct foo { double x; }" as a standalone
> variable should have alignment 8, not 4. Andrew's test shows it has
> an alignment of 4.
Well, what about struct bar { double x; int y; double z; } ?
giving it an alignment of 8 doesn't improve things, as one double will
always be misaligned. OTOH it is odd to have a lower alignment for
bar than for foo, even though the start of bar has the same structure
as the entirety of foo.
--
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658