Linux/ARM: Bus error with -O3 flag of clang/llvm-3.6 while running unit-test of .NET Core
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 9 09:40:47 PDT 2016
On 7 July 2016 at 01:39, Renato Golin via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should
> handle unaligned access, but they can still be se to crash via flags.
The crashing instruction (ed940b00) was "vldr d0, [r4]" which does not
permit unaligned accesses even when they're generally allowed (I
My guess is the IR being produced is wrong in some way, likely
producing a misaligned double value given the instruction. An LLVM bug
is certainly possible, but less likely.
> BTW, What does "they can still be se to crash via flags." statement mean?
There's a flag in one of the system registers controlling whether
unaligned accesses are generally permitted. But it's not usually set
to ban them on Linux, and wouldn't affect vldr anyway, so I don't
think it applies here.
> I have tried to build coreclr (.net core runtime) with "-mno-unaligned-access" compiler flag + -O3 flag
> with the latest snapshot version of clang/llvm.
That would only work if the alignment fault was in the basic code. As
you've realised, it's more likely to be in the dynamically JITed
output. This option wouldn't help anyway though: LLVM already believes
it's doing an aligned access or it wouldn't use that instruction.
More information about the llvm-commits