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. --- include/libc-symbols.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/libc-symbols.h b/include/libc-symbols.h index f043ce0850..a3b6274bad 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -782,4 +782,14 @@ for linking") #define libc_ifunc_hidden_def(name) \ libc_ifunc_hidden_def1 (__GI_##name, name) +/* Add the compiler optimization to inhibit loop transformation to library + calls. This is used to avoid recursive calls in memset and memmove + default implementations. */ +#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL +# define inhibit_loop_to_libcall \ + __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) +#else +# define inhibit_loop_to_libcall +#endif + #endif /* libc-symbols.h */ -- cgit 1.4.1