sync/atomic: use strong form of atomic_compare_exchange_n

In the recent change to use atomic_compare_exchange_n I thought we
could use the weak form, which can spuriously fail. But that is not
how it is implemented in the gc library, and it is not what the rest
of the library expects.

Thanks to Lynn Boger for identifying the problem.

Fixes https://gcc.gnu.org/PR89199

Change-Id: I78dea34f1b92b84ec4367b4029a6253d599858fa
Reviewed-on: https://go-review.googlesource.com/c/161359
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/go/sync/atomic/atomic.c b/libgo/go/sync/atomic/atomic.c
index 25e439d..90a4ff3 100644
--- a/libgo/go/sync/atomic/atomic.c
+++ b/libgo/go/sync/atomic/atomic.c
@@ -69,7 +69,7 @@
 _Bool
 CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new)
 {
-  return __atomic_compare_exchange_n (val, &old, new, true, __ATOMIC_SEQ_CST,
+  return __atomic_compare_exchange_n (val, &old, new, false, __ATOMIC_SEQ_CST,
 				      __ATOMIC_RELAXED);
 }
 
@@ -82,7 +82,7 @@
 {
   if (((uintptr_t) val & 7) != 0)
     val = NULL;
-  return __atomic_compare_exchange_n (val, &old, new, true, __ATOMIC_SEQ_CST,
+  return __atomic_compare_exchange_n (val, &old, new, false, __ATOMIC_SEQ_CST,
 				      __ATOMIC_RELAXED);
 }
 
@@ -93,7 +93,7 @@
 _Bool
 CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new)
 {
-  return __atomic_compare_exchange_n (val, &old, new, true, __ATOMIC_SEQ_CST,
+  return __atomic_compare_exchange_n (val, &old, new, false, __ATOMIC_SEQ_CST,
 				      __ATOMIC_RELAXED);
 }
 
@@ -106,7 +106,7 @@
 {
   if (((uintptr_t) val & 7) != 0)
     val = NULL;
-  return __atomic_compare_exchange_n (val, &old, new, true, __ATOMIC_SEQ_CST,
+  return __atomic_compare_exchange_n (val, &old, new, false, __ATOMIC_SEQ_CST,
 				      __ATOMIC_RELAXED);
 }
 
@@ -117,7 +117,7 @@
 _Bool
 CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new)
 {
-  return __atomic_compare_exchange_n (val, &old, new, true, __ATOMIC_SEQ_CST,
+  return __atomic_compare_exchange_n (val, &old, new, false, __ATOMIC_SEQ_CST,
 				      __ATOMIC_RELAXED);
 }