[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: Using BIGGEST_ALIGNMENT to remove alignment constraints
From:       Eric Botcazou <ebotcazou () adacore ! com>
Date:       2013-11-26 17:13:49
Message-ID: 2465611.pF43JbygYs () polaris
[Download RAW message or body]

> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic