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: Using BIGGEST_ALIGNMENT to remove alignment constraints


> I am slightly confused about the BIGGEST_ALIGNMENT docs which state:
> "Biggest alignment that any data type can require on this machine, in bits.
> Note that this is not the biggest alignment that is supported, just the
> biggest alignment that, when violated, may cause a fault."
>
> What kind of fault would this be?

Unaligned memory access fault.

> I am tempted to set BIGGEST_ALIGNMENT to 8 so I can force GCC to just align
> the data at any byte boundary. Would this be a fair use of
> BIGGEST_ALIGNMENT?

Yes, you may set BIGGEST_ALIGNMENT to 8 if unaligned memory accesses can never 
generate a fault on the architecture.  But, in practice, you might want to 
take into account performance considerations.

-- 
Eric Botcazou


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