]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/46914 (std::atomic<int*>::exchange(...) doesn't store correct value.)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 1 Feb 2011 18:15:56 +0000 (18:15 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 1 Feb 2011 18:15:56 +0000 (18:15 +0000)
2011-02-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/46914
* include/bits/atomic_0.h (_ATOMIC_STORE_, _ATOMIC_MODIFY_,
_ATOMIC_CMPEXCHNG_): Rename __v -> __w, and __m -> __n, to
avoid name conflicts.

From-SVN: r169495

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/atomic_0.h

index 71f4b7e06aa1ea461396ef30ff7fe51247386ff9..49ad77af26aaedb7f69065f2fb6ce234350f146d 100644 (file)
@@ -1,3 +1,10 @@
+2011-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/46914
+       * include/bits/atomic_0.h (_ATOMIC_STORE_, _ATOMIC_MODIFY_,
+       _ATOMIC_CMPEXCHNG_): Rename __v -> __w, and __m -> __n, to
+       avoid name conflicts.
+
 2011-01-30  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * doc/xml/manual/codecvt.xml: Fix link to The Austin Common
index a39de4a79269779ba2594367653d20529d3549a3..8a46f76b17f504a5a3ba22fe53f2a4855eddf6ea 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*- header.
 
-// Copyright (C) 2008, 2009
+// Copyright (C) 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -49,34 +49,34 @@ namespace __atomic0
     atomic_flag_clear_explicit(__g, __x);                                 \
     __r; })
 
-#define _ATOMIC_STORE_(__a, __m, __x)                                     \
+#define _ATOMIC_STORE_(__a, __n, __x)                                     \
   ({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_;                           \
-    __typeof__(__m) __v = (__m);                                          \
+    __typeof__(__n) __w = (__n);                                          \
     __atomic_flag_base* __g = __atomic_flag_for_address(__p);             \
     __atomic_flag_wait_explicit(__g, __x);                                \
-    *__p = __v;                                                                   \
+    *__p = __w;                                                                   \
     atomic_flag_clear_explicit(__g, __x);                                 \
-    __v; })
+    __w; })
 
-#define _ATOMIC_MODIFY_(__a, __o, __m, __x)                               \
+#define _ATOMIC_MODIFY_(__a, __o, __n, __x)                               \
   ({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_;                           \
-    __typeof__(__m) __v = (__m);                                          \
+    __typeof__(__n) __w = (__n);                                          \
     __atomic_flag_base* __g = __atomic_flag_for_address(__p);             \
     __atomic_flag_wait_explicit(__g, __x);                                \
     __typeof__ _ATOMIC_MEMBER_ __r = *__p;                                \
-    *__p __o __v;                                                         \
+    *__p __o __w;                                                         \
     atomic_flag_clear_explicit(__g, __x);                                 \
     __r; })
 
-#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x)                            \
+#define _ATOMIC_CMPEXCHNG_(__a, __e, __n, __x)                            \
   ({__typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_;                           \
     __typeof__(__e) __q = (__e);                                          \
-    __typeof__(__m) __v = (__m);                                          \
+    __typeof__(__n) __w = (__n);                                          \
     bool __r;                                                             \
     __atomic_flag_base* __g = __atomic_flag_for_address(__p);             \
     __atomic_flag_wait_explicit(__g, __x);                                \
     __typeof__ _ATOMIC_MEMBER_ __t__ = *__p;                              \
-    if (__t__ == *__q) { *__p = __v; __r = true; }                        \
+    if (__t__ == *__q) { *__p = __w; __r = true; }                        \
     else { *__q = __t__; __r = false; }                                           \
     atomic_flag_clear_explicit(__g, __x);                                 \
     __r; })