[llvm-dev] alloca + strd issue on arm freebsd

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 11 07:35:13 PDT 2017


Hi Karnajit,

On 10 October 2017 at 21:16, karnajit wangkhem via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> $ clang -v
> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM
> 3.8.0)
> Target: armv6--freebsd11.0-gnueabihf
> Thread model: posix
> InstalledDir: /usr/bin

[...]

>   %2 = alloca i8
>   %3 = alloca i8, i32 8

This looks like a bug in how the alloca function is handled in Clang
3.8. Those instructions should be tagged with some ABI-sensible
alignment, and they are in newer versions of Clang but obviously not
back then.

So you probably either need to upgrade your compiler or work around
the bug by allocating more than you need and manually aligning the
result.

Cheers.

Tim.


More information about the llvm-dev mailing list