diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-04 00:49:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-04 00:49:47 +0000 |
commit | 084996f1d1d1f155146370692339e52d895f6c41 (patch) | |
tree | 76e7890cb0df366dd7820b88386401a0f81c6dc1 /libgo/configure.ac | |
parent | 6dc546182134d436567f8fbb11a390cd0c9ecb72 (diff) | |
download | gcc-084996f1d1d1f155146370692339e52d895f6c41.zip gcc-084996f1d1d1f155146370692339e52d895f6c41.tar.gz gcc-084996f1d1d1f155146370692339e52d895f6c41.tar.bz2 |
Implement __sync_fetch_and_add_4 if necessary.
From-SVN: r169820
Diffstat (limited to 'libgo/configure.ac')
-rw-r--r-- | libgo/configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/configure.ac b/libgo/configure.ac index 1c75b3e..da56610 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], |