2006-08-31  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/28671 continued
	* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Don't use
	CXXFLAGS when checking for atomic builtins.
	* configure: Regenerate.
	* include/bits/atomicity.h: Revert.
	
Index: include/bits/atomicity.h
===================================================================
--- include/bits/atomicity.h	(revision 116601)
+++ include/bits/atomicity.h	(working copy)
@@ -41,6 +41,15 @@
 
 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
+#ifdef _GLIBCXX_ATOMIC_BUILTINS
+  static inline _Atomic_word 
+  __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+  { return __sync_fetch_and_add(__mem, __val); }
+
+  static inline void
+  __atomic_add(volatile _Atomic_word* __mem, int __val)
+  { __sync_fetch_and_add(__mem, __val); }
+#else
   _Atomic_word
   __attribute__ ((__unused__))
   __exchange_and_add(volatile _Atomic_word* __mem, int __val);
@@ -48,6 +57,7 @@
   void
   __attribute__ ((__unused__))
   __atomic_add(volatile _Atomic_word* __mem, int __val);
+#endif
 
   static inline _Atomic_word
   __exchange_and_add_single(_Atomic_word* __mem, int __val)
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 116600)
+++ acinclude.m4	(working copy)
@@ -2007,7 +2007,7 @@
 }
 EOF
     old_CXXFLAGS="$CXXFLAGS"
-    CXXFLAGS="$CXXFLAGS -S"
+    CXXFLAGS=-S
     if AC_TRY_EVAL(ac_compile); then
       if grep __sync_fetch_and_add conftest.s >/dev/null 2>&1 ; then
         enable_atomic_builtins=no
