From: Hans-Peter Nilsson Date: Sun, 11 Nov 2018 22:20:19 +0000 (+0000) Subject: re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free instea... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63100c54335ac179337b6efff89243c75124b1a3;p=gcc.git re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free instead of __atomic_is_lock_free) 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::is_lock_free()): Likewise. From-SVN: r266018 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ceaac2db195..4742ea41f8d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2018-11-11 Hans-Peter Nilsson + + 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::is_lock_free()): Likewise. + 2018-11-11 Jonathan Wakely Implement P0318R1 unwrap_ref_decay and unwrap_reference diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 7a3354d9e6f..57d51bf3fad 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // Use a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), - reinterpret_cast(-__alignof(_M_i))); + reinterpret_cast(-_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(-__alignof(_M_i))); + reinterpret_cast(-_S_alignment)); } _GLIBCXX_ALWAYS_INLINE void diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 002604676cd..83206dc63a0 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // Produce a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), - reinterpret_cast(-__alignof(_M_i))); + reinterpret_cast(-_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(-__alignof(_M_i))); + reinterpret_cast(-_S_alignment)); } #if __cplusplus >= 201703L