From 85c2e6110c9a01ec817c30f1b7e20549d7229987 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 20 Jun 2013 19:40:55 -0500 Subject: 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. --- string/memmove.c | 1 + string/memset.c | 1 + string/test-memmove.c | 1 + string/test-memset.c | 1 + 4 files changed, 4 insertions(+) (limited to 'string') diff --git a/string/memmove.c b/string/memmove.c index 9dcd2f1f68..ec61e28c60 100644 --- a/string/memmove.c +++ b/string/memmove.c @@ -41,6 +41,7 @@ #endif rettype +inhibit_loop_to_libcall MEMMOVE (a1, a2, len) a1const void *a1; a2const void *a2; diff --git a/string/memset.c b/string/memset.c index 868be53bf9..74b5409218 100644 --- a/string/memset.c +++ b/string/memset.c @@ -21,6 +21,7 @@ #undef memset void * +inhibit_loop_to_libcall memset (dstpp, c, len) void *dstpp; int c; diff --git a/string/test-memmove.c b/string/test-memmove.c index 4ec55b2fcc..94576a299b 100644 --- a/string/test-memmove.c +++ b/string/test-memmove.c @@ -47,6 +47,7 @@ IMPL (memmove, 1) #endif char * +inhibit_loop_to_libcall simple_memmove (char *dst, const char *src, size_t n) { char *ret = dst; diff --git a/string/test-memset.c b/string/test-memset.c index 9981fcef46..72a390e7d9 100644 --- a/string/test-memset.c +++ b/string/test-memset.c @@ -64,6 +64,7 @@ builtin_memset (char *s, int c, size_t n) #endif char * +inhibit_loop_to_libcall simple_memset (char *s, int c, size_t n) { char *r = s, *end = s + n; -- cgit 1.4.1