Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-10 fails to compile C-embedded assembly with SSE and AVX instructions #47166

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR48197
Status NEW
Importance P enhancement
Reported by Yuri (yuri@tsoft.com)
Reported on 2020-11-16 15:58:23 -0800
Last modified on 2020-11-16 15:58:57 -0800
Version 10.0
Hardware PC FreeBSD
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments test_sse.cpp (314 bytes, text/x-c++src)
test_avx.cpp (341 bytes, text/x-c++src)
Blocks
Blocked by
See also
The attached testcases test_sse.cpp and test_avx.cpp fail on FreeBSD 12.2 with
clang-10:

> [yuri@yv /tmp/llvm-asm-failure]$ c++ -O2 -fPIC -o test_sse.gcc.o -msse -c
test_sse.cpp
> test_sse.cpp:9:39: error: expected relocatable expression
>         "movups 0x00 + %[xs], %%xmm0\n\t"
>                                       ^
> <inline asm>:2:2: note: instantiated into assembly here
>         movups %xmm0, 0x00 + (%rax)
>         ^
> 1 error generated.
> [yuri@yv /tmp/llvm-asm-failure]$ c++ -O2 -fPIC -o test_sse.gcc.o -msse -c
test_avx.cpp
> test_avx.cpp:9:40: error: expected relocatable expression
>         "vmovups 0x00 + %[xs], %%ymm0\n\t"
>                                        ^
> <inline asm>:2:2: note: instantiated into assembly here
>         vmovups %ymm0, 0x00 + (%rax)
>         ^
> 1 error generated.

Originally spotted by the author of LSP-plugins Vladimir Sadovnikov:
https://github.com/sadko4u/lsp-plugins/issues/154#issuecomment-728394467
Quuxplusone commented 3 years ago

Attached test_sse.cpp (314 bytes, text/x-c++src): test_sse.cpp

Quuxplusone commented 3 years ago

Attached test_avx.cpp (341 bytes, text/x-c++src): test_avx.cpp