[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #19 from Peter Dimov --- This should work. I still don't understand why JF so insisted on all these padding shenanigans.

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #18 from Jonathan Wakely --- So maybe: diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index aa7374bb252..662cff39df5 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #17 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #15) > --- a/libstdc++-v3/include/std/atomic > +++ b/libstdc++-v3/include/std/atomic > @@ -238,8 +238,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > >

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #16 from Jonathan Wakely --- Alternatively, we could skip all the padding cope in compare_exchange for C++11, since that was a C++20 change and not a DR.

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #15 from Jonathan Wakely --- --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -238,8 +238,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr atomic(_Tp __i) noexcept : _M_i(__i) { -#if

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-05-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #14 from Jonathan Wakely --- Because a constexpr function can't have an if statement in C++11. But maybe we should just clear padding unconditionally for C++11.

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-04-26 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #13 from Peter Dimov --- (In reply to Andrew Pinski from comment #10) > #if __cplusplus >= 201402L && __has_builtin(__builtin_clear_padding) > if _GLIBCXX17_CONSTEXPR (__atomic_impl::__maybe_has_padding<_Tp>()) >

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-04-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #12 from Andrew Pinski --- (In reply to Peter Dimov from comment #11) > So, basically, C++14 and above initialize the padding of > > ``` > std::atomic state{{ 0, 0x }}; > ``` > > in `main` to zero, which masks the problem

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-04-26 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 --- Comment #11 from Peter Dimov --- So, basically, C++14 and above initialize the padding of ``` std::atomic state{{ 0, 0x }}; ``` in `main` to zero, which masks the problem in `generate`. (The problem in `generate` still exists

[Bug libstdc++/114865] [13/14/15 Regression] std::atomic::compare_exchange_strong seems to hang under GCC 13 for C++11

2024-04-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865 Andrew Pinski changed: What|Removed |Added Summary|[13/14/15 Regression] |[13/14/15 Regression]