[llvm-dev] [BUG] 3.8 alignment/struct padding

Ramkumar Ramachandra via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 29 18:00:31 PDT 2016


Thanks Tim.

Cheers.
On Tue, Jun 28, 2016 at 3:07 PM Tim Northover <t.p.northover at gmail.com>
wrote:

> On 28 June 2016 at 11:59, Ramkumar Ramachandra via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I have what appears to be an alignment/struct padding bug. An i64 is not
> > correctly aligned to the 8-byte boundary, and this results in a
> mismatched
> > struct size between C and LLVM. We are currently running 3.8, and did
> not see
> > this bug in 3.5.
>
> LLVM needs to be provided with a datalayout to calculate correct
> struct offsets, and for historical reasons the default alignment
> requirement for i64 is only 32-bits. I suspect you're just relying on
> this default, you should be able to crib the correct layout from a
> Clang-compiled C file and use Module::setDataLayout to fix it.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160630/68da2e16/attachment.html>


More information about the llvm-dev mailing list