| Issue |
164939
|
| Summary |
[libc] non-local conditional branch (cbz) in aarch64/sigsetjmp.cpp
|
| Labels |
libc
|
| Assignees |
|
| Reporter |
bojle
|
sigsetjmp.cpp in [aarch64/sigsetjmp.cpp](https://github.com/llvm/llvm-project/blob/a1e59bdc173187ec47e6ede69c99316eaee9e375/libc/src/setjmp/aarch64/sigsetjmp.cpp#L20) uses a non-local label (that of setjmp) in the cbz instruction. Compiling this on aarch64 (MacOS) leads to an error:
```
error: conditional branch requires assembler-local label. '__ZN22__llvm_libc_22_0_0_git6setjmpEP9__jmp_buf' is external.
20 | cbz w1, %c[setjmp]
| ^
<inline asm>:2:7: note: instantiated into assembly here
2 | cbz w1, __ZN22__llvm_libc_22_0_0_git6setjmpEP9__jmp_buf
```
Here's a minimal reproducible example:
```
void external_target(void) {}
void foo(int condition) {
asm volatile(
// ERROR: cbz requires a local label (e.g., .Lskip_target), not an
// external symbol.
"cbz w0, %c[target] \n"
"nop \n"
:
: [target] "i"(external_target)
: "w0"
);
}
int main() {
foo(0);
return 0;
}
```
Compile this with clang -target aarch64 example.c -o a
@michaelrj-google
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs