clang ios xcode 8.1 saturate.c:3:19: error: couldn't allocate output register for constraint 'w' |
|
Issue description
Version: xcode 8.1
OS: ios
What steps will reproduce the problem?
1. compile this code
int saturate_32bit_to_16bit_2(int a) {
int ret;
asm volatile ("sqxtn %h[ret], %s[a]\n"
"sxtl %[ret].4s, %[ret].4h\n"
: [ret] "=w" (ret)
: [a] "w" (a)
:);
return ret;
}
What is the expected output?
with this it works
src/third_party/llvm-build/Release+Asserts/bin/clang -arch arm64 -c saturate.c
What do you see instead?
with xcode 8.1 it fails:
clang -arch arm64 -c saturate.c
saturate.c:3:19: error: couldn't allocate output register for constraint 'w'
asm volatile ("sqxtn %h[ret], %s[a]\n"
^
1 error generated.
Please use labels and text to provide additional information.
This code snippet exposed a bug in clang which is fixed upstream at llvm.org in llvm 3.8+ and pulled into chrome and android, but not into xcode.
,
Sep 22 2016
../build/libyuv/libyuv/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang -arch arm64 -c saturate.c otool -tV saturate.o saturate.o: (__TEXT,__text) section _saturate_32bit_to_16bit_2: 0000000000000000 sub sp, sp, #16 0000000000000004 str w0, [sp, #12] 0000000000000008 ldr w0, [sp, #12] 000000000000000c fmov s0, w0 0000000000000010 sqxtn h0, s0 0000000000000014 sshll.4s v0, v0, #0 0000000000000018 fmov w0, s0 000000000000001c str w0, [sp, #8] 0000000000000020 ldr w0, [sp, #8] 0000000000000024 add sp, sp, #16 0000000000000028 ret bash-3.2$
,
Sep 23 2016
reported to apple issue # 28436351 https://bugreport.apple.com/problem/viewproblem#28436351 can we use chromeclang? |
|
►
Sign in to add a comment |
|
Comment 1 by thakis@chromium.org
, Sep 22 2016Status: WontFix (was: Untriaged)