New issue
Advanced search Search tips

Issue 649508 link

Starred by 0 users

Issue metadata

Status: WontFix
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

clang ios xcode 8.1 saturate.c:3:19: error: couldn't allocate output register for constraint 'w'

Project Member Reported by fbarchard@chromium.org, Sep 22 2016

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.


 

Comment 1 by thakis@chromium.org, Sep 22 2016

Cc: justincohen@chromium.org
Status: WontFix (was: Untriaged)
We can't do anything about Xcode. Please file this at bugreporter.apple.com instead (saying "works in clang trunk" is probably useful").

Justin, on some other bug you mentioned trying sending out a chromeclang-build chrome to the app store and see how it fares, is that still happening? Maybe we could switch to chrome clang eventually.
../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$ 

reported to apple issue # 28436351
https://bugreport.apple.com/problem/viewproblem#28436351

can we use chromeclang?

Sign in to add a comment