diff mbox

Remove defines to builtins in string2.h

Message ID AM5PR0802MB261040E99C0EB8FBC85BA14383B00@AM5PR0802MB2610.eurprd08.prod.outlook.com
State Superseded
Headers show

Commit Message

Wilco Dijkstra Nov. 18, 2016, 3:37 p.m. UTC
As discussed in https://sourceware.org/ml/libc-alpha/2016-11/msg00625.html,
for C90 functions there is no need to use a define to the GCC builtin as
an optimization.  So remove the defines for strchr, strncpy, strcspn, strspn
and strpbrk from string/bits/string2.h.

ChangeLog:
2015-11-18  Wilco Dijkstra  <wdijkstr@arm.com>

	* string/bits/string2.h (strchr) Remove define.
	(strncpy): Likewise.
	(strcspn): Likewise.
	(strspn): Likewise.
	(strpbrk): Likewise.
--
diff mbox

Patch

diff --git a/string/bits/string2.h b/string/bits/string2.h
index 8fa35d52e7c8e3ff592573fa64472da526e8616d..265e9b6eb88b2d4935d683ec733c56b09580a1fb 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -58,11 +58,6 @@ 
 #endif
 
 
-#ifndef _HAVE_STRING_ARCH_strchr
-# define strchr(s, c) __builtin_strchr (s, c)
-#endif
-
-
 /* Copy SRC to DEST, returning pointer to final NUL byte.  */
 #ifdef __USE_GNU
 # ifndef _HAVE_STRING_ARCH_stpcpy
@@ -74,12 +69,6 @@ 
 #endif
 
 
-/* Copy no more than N characters of SRC to DEST.  */
-#ifndef _HAVE_STRING_ARCH_strncpy
-# define strncpy(dest, src, n) __builtin_strncpy (dest, src, n)
-#endif
-
-
 /* Append no more than N characters from SRC onto DEST.  */
 #ifndef _HAVE_STRING_ARCH_strncat
 # ifdef _USE_STRING_ARCH_strchr
@@ -155,26 +144,6 @@ 
 #endif
 
 
-/* Return the length of the initial segment of S which
-   consists entirely of characters not in REJECT.  */
-#ifndef _HAVE_STRING_ARCH_strcspn
-# define strcspn(s, reject) __builtin_strcspn (s, reject)
-#endif
-
-
-/* Return the length of the initial segment of S which
-   consists entirely of characters in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strspn
-# define strspn(s, accept) __builtin_strspn (s, accept)
-#endif
-
-
-/* Find the first occurrence in S of any character in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strpbrk
-# define strpbrk(s, accept) __builtin_strpbrk (s, accept)
-#endif
-
-
 #if !defined _HAVE_STRING_ARCH_strsep
 # ifdef __USE_MISC
 #  define strsep(s, reject) __strsep (s, reject)