summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-06-20 19:40:55 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-06-20 19:42:05 -0500
commit85c2e6110c9a01ec817c30f1b7e20549d7229987 (patch)
tree9b044403d906f9aaa6930484ae6d60dc687ecc19 /configure.in
parentb8c792af85fe3ff65c0cd68e2f291072a60cd953 (diff)
Fix loop construction to functions calls
Check wheter the compiler has the option -fno-tree-loop-distribute-patterns to inhibit loop transformation to library calls and uses it on memset and memmove default implementation to avoid recursive calls.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 8b110817bc..56cd61c171 100644
--- a/configure.in
+++ b/configure.in
@@ -1964,6 +1964,24 @@ if test -n "$submachine"; then
fi
AC_SUBST(libc_cv_cc_submachine)
+AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
+__attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
+cat > conftest.c <<EOF
+void
+__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
+foo (void) {}
+EOF
+libc_cv_cc_loop_to_function=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c])
+then
+ libc_cv_cc_loop_to_function=yes
+fi
+rm -f conftest*])
+if test $libc_cv_cc_loop_to_function = yes; then
+ AC_DEFINE(HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
+fi
+AC_SUBST(libc_cv_cc_loop_to_function)
+
dnl Check whether we have the gd library available.
AC_MSG_CHECKING(for libgd)
if test "$with_gd" != "no"; then