This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: _GLIBCXX_ATOMIC_BUILTINS too coarse
- From: Alan Modra <amodra at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 14 Apr 2012 22:53:38 +0930
- Subject: Re: _GLIBCXX_ATOMIC_BUILTINS too coarse
- References: <CAH6eHdTcADgrrJiv2mxjNjw5_n-cQY9zeiJhVoCWkJa_hS6wYQ@mail.gmail.com>
This patch partially reverts the change made on 2012-02-10 that
partially disabled builtin atomics on powerpc, resulting in
inconsistent locking (mix of atomics and pthread mutexes) and an ABI
incompatibility with previous versions of libstdc++. See the PR for
all the gory details. Applying to mainline with Jonathan's approval,
and in a few days to the 4.7 branch assuming no problems appear due to
this change on mainline.
PR libstdc++/52839
* acinclude.m4 (_GLIBCXX_ATOMIC_BUILTINS): Do not depend on
glibcxx_cv_atomic_long_long.
* configure: Regenerate.
Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4 (revision 186130)
+++ libstdc++-v3/acinclude.m4 (working copy)
@@ -2861,11 +2861,10 @@
CXXFLAGS="$old_CXXFLAGS"
AC_LANG_RESTORE
- # Set atomicity_dir to builtins if all of above tests pass.
+ # Set atomicity_dir to builtins if all but the long long test above passes.
if test $glibcxx_cv_atomic_bool = yes \
&& test $glibcxx_cv_atomic_short = yes \
- && test $glibcxx_cv_atomic_int = yes \
- && test $glibcxx_cv_atomic_long_long = yes ; then
+ && test $glibcxx_cv_atomic_int = yes; then
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1,
[Define if the compiler supports C++11 atomics.])
atomicity_dir=cpu/generic/atomicity_builtins
--
Alan Modra
Australia Development Lab, IBM