]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix recent regression in __atomic_add_dispatch
authorJonathan Wakely <jwakely@redhat.com>
Sat, 6 Jul 2019 21:16:38 +0000 (22:16 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 6 Jul 2019 21:16:38 +0000 (22:16 +0100)
* 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
libstdc++-v3/include/ext/atomicity.h

index 334673c6888672bf401019796e2ddb4ae8d1f3ac..f595f9d664e9a68f2f84a36f256a808468a7dfd2 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-06  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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  <jwakely@redhat.com>
 
        * include/ext/atomicity.h [_GLIBCXX_ATOMIC_BUILTINS] (__atomic_add)
index 73225b3de207df5d6d514239b628cea207fb6e5e..333c8843e14cd1e6fbc356317febb4391ef6b281 100644 (file)
@@ -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);
   }