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: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT


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


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