[cfe-dev] LLVM error with SSE4.1 intrinsics and LTO

Jonathan 'Rynn' Sauer jonathan.sauer at gmx.de
Thu Jul 10 08:34:37 PDT 2014


Hello,

> I posted this to llvm-dev but didn't get any response, I'm re-trying
> here in case it is related to the clang driver somehow.
> 
> The following program does not link correctly when using LTO:
> 
> "clang -flto -msse4.1 test.c"
> 
> #include <smmintrin.h>
> 
> int main() {
>    __m128i a = _mm_set1_epi32(2);
>    __m128i b = _mm_set1_epi32(1);
>    __m128i c = _mm_min_epi32(a, b); // or _mm_max_epi32
>    return c[0] == 0; // just so c doesn't opt away
> }
> 
> It works fine without "-flto".
> 
> I've reproduced this using 3.4.2 as well as 3.5 (from trunk) on both
> Linux and OS X.
> 
> Am I missing some flags to tell the linker to enable sse4.1? Or is
> there a bug here?

There is: http://llvm.org/bugs/show_bug.cgi?id=15792 (includes a workaround)


Jonathan




More information about the cfe-dev mailing list