From a10b664eb7a5b8de4e84c6a87e5e462da8c69133 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 6 Jul 2019 22:16:38 +0100 Subject: [PATCH] Fix recent regression in __atomic_add_dispatch * include/ext/atomicity.h (__exchange_and_add, __atomic_add): Replace throw() with _GLIBCXX_NOTHROW. (__atomic_add_dispatch): Return after performing atomic increment. From-SVN: r273167 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/ext/atomicity.h | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 334673c6888..f595f9d664e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2019-07-06 Jonathan Wakely + + * include/ext/atomicity.h (__exchange_and_add, __atomic_add): Replace + throw() with _GLIBCXX_NOTHROW. + (__atomic_add_dispatch): Return after performing atomic increment. + 2019-07-05 Jonathan Wakely * include/ext/atomicity.h [_GLIBCXX_ATOMIC_BUILTINS] (__atomic_add) diff --git a/libstdc++-v3/include/ext/atomicity.h b/libstdc++-v3/include/ext/atomicity.h index 73225b3de20..333c8843e14 100644 --- a/libstdc++-v3/include/ext/atomicity.h +++ b/libstdc++-v3/include/ext/atomicity.h @@ -55,10 +55,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); } #else _Atomic_word - __exchange_and_add(volatile _Atomic_word*, int) throw (); + __exchange_and_add(volatile _Atomic_word*, int) _GLIBCXX_NOTHROW; void - __atomic_add(volatile _Atomic_word*, int) throw (); + __atomic_add(volatile _Atomic_word*, int) _GLIBCXX_NOTHROW; #endif inline _Atomic_word @@ -92,7 +92,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { #ifdef __GTHREADS if (__gthread_active_p()) - __atomic_add(__mem, __val); + { + __atomic_add(__mem, __val); + return; + } #endif __atomic_add_single(__mem, __val); } -- 2.30.2