]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free instea...
authorHans-Peter Nilsson <hp@axis.com>
Sun, 11 Nov 2018 22:20:19 +0000 (22:20 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sun, 11 Nov 2018 22:20:19 +0000 (22:20 +0000)
PR libstdc++-v3/54005
* include/bits/atomic_base.h (__atomic_base<_TTp>::is_lock_free(),
__atomic_base<_PTp*>::is_lock_free()): Call __atomic_always_lock_free
with the type-derived _S_alignment instead of __alignof the object.
* include/std/atomic (atomic<T>::is_lock_free()): Likewise.

From-SVN: r266018

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/std/atomic

index ceaac2db195d2466834ce5ae12c09ae5f89cedea..4742ea41f8dd4b78609d144d43fd538486720548 100644 (file)
@@ -1,3 +1,11 @@
+2018-11-11  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR libstdc++-v3/54005
+       * include/bits/atomic_base.h (__atomic_base<_TTp>::is_lock_free(),
+       __atomic_base<_PTp*>::is_lock_free()): Call __atomic_always_lock_free
+       with the type-derived _S_alignment instead of __alignof the object.
+       * include/std/atomic (atomic<T>::is_lock_free()): Likewise.
+
 2018-11-11  Jonathan Wakely  <jwakely@redhat.com>
 
        Implement P0318R1 unwrap_ref_decay and unwrap_reference
index 7a3354d9e6f9d7c98da996466b0c7e818ea1d6c3..57d51bf3fad454d94639ea26fd482026471f0d38 100644 (file)
@@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        // Use a fake, minimally aligned pointer.
        return __atomic_is_lock_free(sizeof(_M_i),
-           reinterpret_cast<void *>(-__alignof(_M_i)));
+           reinterpret_cast<void *>(-_S_alignment));
       }
 
       bool
@@ -363,7 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        // Use a fake, minimally aligned pointer.
        return __atomic_is_lock_free(sizeof(_M_i),
-           reinterpret_cast<void *>(-__alignof(_M_i)));
+           reinterpret_cast<void *>(-_S_alignment));
       }
 
       _GLIBCXX_ALWAYS_INLINE void
index 002604676cd47f36c35d98c9d86bad450aafd763..83206dc63a067af9c1815f47227f6a807ba3a156 100644 (file)
@@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        // Produce a fake, minimally aligned pointer.
        return __atomic_is_lock_free(sizeof(_M_i),
-           reinterpret_cast<void *>(-__alignof(_M_i)));
+           reinterpret_cast<void *>(-_S_alignment));
       }
 
       bool
@@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        // Produce a fake, minimally aligned pointer.
        return __atomic_is_lock_free(sizeof(_M_i),
-           reinterpret_cast<void *>(-__alignof(_M_i)));
+           reinterpret_cast<void *>(-_S_alignment));
       }
 
 #if __cplusplus >= 201703L