summaryrefslogtreecommitdiff
path: root/libgo/configure.ac
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-04 00:49:47 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-04 00:49:47 +0000
commitcb6f50ce2caf83ac6c0908700851650590c9498a (patch)
tree76e7890cb0df366dd7820b88386401a0f81c6dc1 /libgo/configure.ac
parenta40344730aa1ccc7ba84749769dd5fbaa47471f8 (diff)
downloadgcc-cb6f50ce2caf83ac6c0908700851650590c9498a.tar.gz
Implement __sync_fetch_and_add_4 if necessary.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/configure.ac')
-rw-r--r--libgo/configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 1c75b3ef6d2..da56610b579 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -396,6 +396,20 @@ if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; then
[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])
fi
+AC_CACHE_CHECK([for __sync_fetch_and_add_4],
+[libgo_cv_func___sync_fetch_and_add_4],
+[AC_LINK_IFELSE([
+typedef unsigned int uint32 __attribute__ ((mode (SI)));
+uint32 i;
+int main() { return __sync_fetch_and_add (&i, 1); }
+],
+[libgo_cv_func___sync_fetch_and_add_4=yes],
+[libgo_cv_func___sync_fetch_and_add_4=no])])
+if test "$libgo_cv_func___sync_fetch_and_add_4" = "yes"; then
+ AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD_4, 1,
+ [Define to 1 if the compiler provides the __sync_fetch_and_add function for uint32])
+fi
+
dnl For x86 we want to use the -minline-all-stringops option to avoid
dnl forcing a stack split when calling memcpy and friends.
AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],