[cfe-dev] Data layout and clang

Eli Friedman eli.friedman at gmail.com
Thu Nov 3 13:36:08 PDT 2011


On Thu, Nov 3, 2011 at 11:10 AM, JP
<jpbonn-keyword-cfedev.957c48 at corniceresearch.com> wrote:
> Clang is generating load and stores with an alignment of 8 for my target
> even though I've set the datalayout and everything else I can think of
> to 32 bit alignment.  Any idea as to what I'm doing wrong?

The relevant code is ASTContext::getPreferredTypeAlign; it should
probably be a per-target thing, but it hasn't really mattered for any
other target.  Patches welcome.

> The problematic line is:
>   store i64 %x, i64* %x.addr, align 8
>
> There's also the discrepancy between the alloca alignment of 4 and the
> store alignment of 8.

Fixed in r143645. Thanks for pointing it out.

-Eli




More information about the cfe-dev mailing list