OSDN Git Service

PR libstdc++/51181
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Nov 2011 01:38:48 +0000 (01:38 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Nov 2011 01:38:48 +0000 (01:38 +0000)
        * libsupc++/eh_tm.cc (free_any_cxa_exception): Protect the use
        of __sync_sub_and_fetch with _GLIBCXX_ATOMIC_BUILTINS_4.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181465 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/eh_tm.cc

index a2b4ceb..c52db38 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-17  Richard Henderson  <rth@redhat.com>
+
+       PR libstdc++/51181
+       * libsupc++/eh_tm.cc (free_any_cxa_exception): Protect the use
+       of __sync_sub_and_fetch with _GLIBCXX_ATOMIC_BUILTINS_4.
+
 2011-11-18  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * testsuite/30_threads/thread/native_handle/typesizes.cc: Do not run
index f5815a1..a646102 100644 (file)
@@ -45,7 +45,9 @@ free_any_cxa_exception (_Unwind_Exception *eo)
       __cxa_free_dependent_exception (dep);
     }
 
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
   if (__sync_sub_and_fetch (&h->referenceCount, 1) == 0)
+#endif
     __cxa_free_exception (h + 1);
 }