diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-04 00:49:47 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-04 00:49:47 +0000 |
commit | cb6f50ce2caf83ac6c0908700851650590c9498a (patch) | |
tree | 76e7890cb0df366dd7820b88386401a0f81c6dc1 /libgo/configure.ac | |
parent | a40344730aa1ccc7ba84749769dd5fbaa47471f8 (diff) | |
download | ppe42-gcc-cb6f50ce2caf83ac6c0908700851650590c9498a.tar.gz ppe42-gcc-cb6f50ce2caf83ac6c0908700851650590c9498a.zip |
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.ac | 14 |
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], |