This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- From: Jamie Lokier <jamie at shareable dot org>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: aoliva at redhat dot com, kenner at vlsi1 dot ultra dot nyu dot edu, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 22 Apr 2003 01:11:28 +0100
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- References: <20030421214129.C4585F28D2@nile.gnat.com>
Robert Dewar wrote:
> So even for objects, specifying an alignment different from that for the
> type may be appropriately needed for functional correctness.
The object alignment has to be >= the type alignment, doesn't it?
At the moment, in C, you can create a static object whose alignment is
less than its type's alignment. The generated code to access the
object does a misaligned access, which is incorrect on some
architectures - assuming those accesses are supposed to have defined behaviour.
-- Jamie