You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clang/clang++ claims incorrectly support of LDREXD/STREXD which are unsupported for M-profile.
Eg. cortex-m85 (v8.1m-main) STREX/LDREX supported variants
Moreover it will generate code for those instructions and won't reject builtins: __builtin_arm_ldrex for 64b integer types.
It goes all the way and also generates invalid code for those.
Please see code below that currently is incorrectly accepted, emits incorrect @llvm.arm.ldrexd llvm intrin, which is later incorrectly lowered to invalid machine instructions for M-profile
I did not check clrex, but most likely also the case.
Please let me know if I it'd be better to report it upstream.
It is also reproducible with upstream clang-20 HEAD.
Just thought since it is ACLE related I will report it here.
And since it's more likely to hit LLVM-embedded-toolchain-for-Arm users, than upstream clang.
Cheers,
/P
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report. Apologies for the delay in responding, we're just coming back off vacation.
It would be best to report this in upstream llvm-project. As a rule of thumb if there is an issue that is specific to the toolchain (integration between clang, binutils, libraries) then it is best to report it here, but if it is purely a code-generation problem with upstream clang/llvm then it is best to report that in source.
If you're OK with raising an issue in llvm-project yourself, we'd be grateful if you could do that? If not, we can raise one for you citing this.
Hello
clang/clang++ claims incorrectly support of
LDREXD/STREXD
which are unsupported for M-profile.Eg. cortex-m85 (v8.1m-main) STREX/LDREX supported variants
Moreover it will generate code for those instructions and won't reject builtins:
__builtin_arm_ldrex
for 64b integer types.It goes all the way and also generates invalid code for those.
0x8 = 1u<<3
claims support dword ldrex/strex according to ACLE docs.Issue was partially fixed for
__atomic_*
but not for:__builtin_arm_ldrex
__builtin_arm_strex
__builtin_arm_ldaex
__builtin_arm_stlex
Please see llvm/llvm-project@aecdf15#diff-9e62f39a84effbc02335327401af81a94a17df39752973987b102676ed207bb1R240
gcc is (I believe) correct about this one.
Please see code below that currently is incorrectly accepted, emits incorrect
@llvm.arm.ldrexd
llvm intrin, which is later incorrectly lowered to invalid machine instructions forM-profile
Disassembly of '-Os':
I did not check
clrex
, but most likely also the case.Please let me know if I it'd be better to report it upstream.
It is also reproducible with upstream clang-20 HEAD.
Just thought since it is ACLE related I will report it here.
And since it's more likely to hit LLVM-embedded-toolchain-for-Arm users, than upstream clang.
Cheers,
/P
The text was updated successfully, but these errors were encountered: