Open appujee opened 4 months ago
Related discussion in https://github.com/android/ndk/issues/2030
@llvm/issue-subscribers-backend-arm
Author: None (appujee)
Reduced down to this, which gives the same error with -asan-use-stack-safety=0
and -asan-use-stack-safety=1
:
template <class b> b *addressof(b &);
void bc() {
_Atomic(long long) bd;
__c11_atomic_store(addressof(bd), 0, 0);
}
void m_fn2(long long p1) { bc(); }
$ /work/llvm/build/bin/clang -std=c++20 -target armv7-unknown-linux -fsanitize=address -c out-of-regs.cpp
clang: warning: unknown platform, assuming -mfloat-abi=soft
clang: warning: unknown platform, assuming -mfloat-abi=soft
clang: warning: unknown platform, assuming -mfloat-abi=soft
error: ran out of registers during register allocation
1 error generated.
The code is pretty big as I haven't spent enough time reducing it. But the repro test case can be found here:
https://godbolt.org/z/WafcG8G95
$ clang++ -std=c++20 -target armv7-unknown-linux -fsanitize=address -mllvm -asan-use-stack-safety=0