DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT

Jamie Lokier jamie@shareable.org
Tue Apr 22 00:11:00 GMT 2003


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



More information about the Gcc-patches mailing list