[all-commits] [llvm/llvm-project] 87283d: [clang][ARM] Fix build failure in <arm_acle.h> for...
Simon Tatham via All-commits
all-commits at lists.llvm.org
Tue Aug 5 00:46:16 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 87283db54852a899a52e4e01aa01b471ffa34a1d
https://github.com/llvm/llvm-project/commit/87283db54852a899a52e4e01aa01b471ffa34a1d
Author: Simon Tatham <simon.tatham at arm.com>
Date: 2025-08-05 (Tue, 05 Aug 2025)
Changed paths:
M clang/lib/Headers/arm_acle.h
M clang/test/CodeGen/arm_acle.c
A clang/test/CodeGen/arm_acle_swp.c
Log Message:
-----------
[clang][ARM] Fix build failure in <arm_acle.h> for __swp (#151354)
In commit d5985905ae8e5b2 I introduced a Sema check that prohibits
`__builtin_arm_ldrex` and `__builtin_arm_strex` for data sizes not
supported by the target architecture version. However, `arm_acle.h`
unconditionally uses those builtins with a 32-bit data size. So now
including that header will cause a build failure on Armv6-M, or historic
architectures like Armv5.
To fix it, `arm_acle.h` now queries the compiler-defined
`__ARM_FEATURE_LDREX` macro (also fixed recently in commit
34f59d79209268e so that it matches the target architecture). If 32-bit
LDREX isn't available it will fall back to the older SWP instruction, or
failing that (on Armv6-M), a libcall.
While I was modifying the header anyway, I also renamed the local
variable `v` inside `__swp` so that it starts with `__`, avoiding any
risk of user code having #defined `v`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list