[cfe-dev] Alignment of bitfield structs

Reid Kleckner rnk at google.com
Tue Apr 21 09:06:59 PDT 2015


Is "ABI alignment" just the alignment of an i64 as specified in DataLayout,
or is it something else? Maybe we are computing that alignment incorrectly,
and the alignment of an i40 should be 4.

Alternatively, we could have Clang slap 'align 4' on the global and call it
fixed.

On Tue, Apr 21, 2015 at 2:59 AM, Renato Golin <renato.golin at linaro.org>
wrote:

> On 21 April 2015 at 10:56, Bradley Smith <bradley.smith at arm.com> wrote:
> > This could indeed be the cause, although from what I understand of the
> comments in CGRecordLayourBuilder this is entirely intentional behaviour.
> (Although I could be wrong).
>
> I can fathom why this was intentional, but as you said, it can't
> possibly take ABI alignment into account. What about the GNU attribute
> alignment? Can't we lower the variable with a fake attribute,
> generated by Clang, that forces ABI alignment?
>
> cheers,
> --renato
>
> PS: I love using bitfields. I hate supporting bitfields. Damn dichotomy!
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150421/21eee19d/attachment.html>


More information about the cfe-dev mailing list