···2020 ARM64_HAS_LDAPR)21212222/*2323+ * Replace this with typeof_unqual() when minimum compiler versions are2424+ * increased to GCC 14 and Clang 19. For the time being, we need this2525+ * workaround, which relies on function return values dropping qualifiers.2626+ */2727+#define __rwonce_typeof_unqual(x) typeof(({ \2828+ __diag_push() \2929+ __diag_ignore_all("-Wignored-qualifiers", "") \3030+ ((typeof(x)(*)(void))0)(); \3131+ __diag_pop() }))3232+3333+/*2334 * When building with LTO, there is an increased risk of the compiler2435 * converting an address dependency headed by a READ_ONCE() invocation2536 * into a control dependency and consequently allowing for harmful···4231 */4332#define __READ_ONCE(x) \4433({ \4545- typeof(&(x)) __x = &(x); \4646- int atomic = 1; \4747- union { __unqual_scalar_typeof(*__x) __val; char __c[1]; } __u; \3434+ auto __x = &(x); \3535+ auto __ret = (__rwonce_typeof_unqual(*__x) *)__x; \3636+ /* Hides alias reassignment from Clang's -Wthread-safety. */ \3737+ auto __retp = &__ret; \3838+ union { typeof(*__ret) __val; char __c[1]; } __u; \3939+ *__retp = &__u.__val; \4840 switch (sizeof(x)) { \4941 case 1: \5042 asm volatile(__LOAD_RCPC(b, %w0, %1) \···7056 : "Q" (*__x) : "memory"); \7157 break; \7258 default: \7373- atomic = 0; \5959+ __u.__val = *(volatile typeof(*__x) *)__x; \7460 } \7575- atomic ? (typeof(*__x))__u.__val : (*(volatile typeof(*__x) *)__x);\6161+ *__ret; \7662})77637864#endif /* !BUILD_VDSO */