https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101379

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Christophe, does this patch work for you?  Another alternative is to add
#pragma GCC diagnostic ignored around the dereference.

diff --git a/libatomic/config/linux/arm/host-config.h
b/libatomic/config/linux/arm/host-config.h
index 1520f237d73..f866b8a1160 100644
--- a/libatomic/config/linux/arm/host-config.h
+++ b/libatomic/config/linux/arm/host-config.h
@@ -39,8 +39,12 @@ typedef void (__kernel_dmb_t) (void);
 #define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)

 /* Kernel helper page version number.  */
-#define __kernel_helper_version (*(unsigned int *)0xffff0ffc)
-
+static inline unsigned
+__kernel_helper_version ()
+{
+  const unsigned *volatile addr = (unsigned int *)0xffff0ffc;
+  return *addr;
+}

 #ifndef HAVE_STREX
 static inline bool

Reply via email to