From patchwork Fri Oct 9 15:52:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 528278 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 71A131402B2 for ; Sat, 10 Oct 2015 02:53:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=BdBHI/Ad; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=e3at1WP6oE/LIMxG3fC+lDBkGW9W3 WnyFdDxDorusU5fR0ibiDo1W1tAjCoChJcM5bs18UAPGGTI5k2FBldfh2YcRHqDs 2Eurp05Jbf7/AB1bBMn8Mb/u8jT+EjxC74G6+dUi7/ZGyp4E0ievOPeh2ehQbQs/ 9ejDF67EeF6F6Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=hbfknK6/FQVsqjR0NAk542jez/4=; b=BdB HI/AdyzEj3L+OAGtwW8DScUTzgxB77T7APT270vmKQ3FzJqmMOUeSexywTfcbGdf X7hHfWHjv6Sw8pUI24iQstIrw9B3JOtBNOl8RPmHkAWF6NxolY0aPnlKvGtYKiyz sJDvQNGGh2POvC9t1091oSzHNty9fSqx3AHbyFPg= Received: (qmail 111660 invoked by alias); 9 Oct 2015 15:52:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 111650 invoked by uid 89); 9 Oct 2015 15:52:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: "'GNU C Library'" Subject: [PATCH 1/2] Remove ancient GCC string inlines Date: Fri, 9 Oct 2015 16:52:44 +0100 Message-ID: <000001d102aa$89d5ef90$9d81ceb0$@com> MIME-Version: 1.0 X-MC-Unique: xiAbgoH0QrqvTtrdE1NyOg-1 Remove pre GCC3.2 optimizations from string/bits/string2.h. Passes AArch64, x86 and x64 regression. OK for commit? ChangeLog: 2015-10-09 Wilco Dijkstra wdijkstr@arm.com * string/bits/string2.h (__STRING2_SMALL_GET16): Remove. (__STRING2_SMALL_GET32): Remove. (memset): Remove. (__memset_1): Remove. (__memset_gc): Remove. (__mempcpy_args): Remove. (strcpy): Remove. (strcpy_args): Remove. (__stpcpy_args): Remove. (strstr): Remove. --- string/bits/string2.h | 364 +------------------------------------------------- 1 file changed, 3 insertions(+), 361 deletions(-) diff --git a/string/bits/string2.h b/string/bits/string2.h index 7645176..bd8c404 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -51,25 +51,6 @@ # include # include -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define __STRING2_SMALL_GET16(src, idx) \ - (((const unsigned char *) (const char *) (src))[idx + 1] << 8 \ - | ((const unsigned char *) (const char *) (src))[idx]) -# define __STRING2_SMALL_GET32(src, idx) \ - (((((const unsigned char *) (const char *) (src))[idx + 3] << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 2]) << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 1]) << 8 \ - | ((const unsigned char *) (const char *) (src))[idx]) -# else -# define __STRING2_SMALL_GET16(src, idx) \ - (((const unsigned char *) (const char *) (src))[idx] << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 1]) -# define __STRING2_SMALL_GET32(src, idx) \ - (((((const unsigned char *) (const char *) (src))[idx] << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 1]) << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 2]) << 8 \ - | ((const unsigned char *) (const char *) (src))[idx + 3]) -# endif #else /* These are a few types we need for the optimizations if we cannot use unaligned memory accesses. */ @@ -94,97 +75,6 @@ __STRING2_COPY_TYPE (8); /* Set N bytes of S to C. */ #if !defined _HAVE_STRING_ARCH_memset -# if !__GNUC_PREREQ (3, 0) -# if _STRING_ARCH_unaligned -# define memset(s, c, n) \ - (__extension__ (__builtin_constant_p (n) && (n) <= 16 \ - ? ((n) == 1 \ - ? __memset_1 (s, c) \ - : __memset_gc (s, c, n)) \ - : (__builtin_constant_p (c) && (c) == '\0' \ - ? ({ void *__s = (s); __bzero (__s, n); __s; }) \ - : memset (s, c, n)))) - -# define __memset_1(s, c) ({ void *__s = (s); \ - *((__uint8_t *) __s) = (__uint8_t) c; __s; }) - -# define __memset_gc(s, c, n) \ - ({ void *__s = (s); \ - union { \ - unsigned int __ui; \ - unsigned short int __usi; \ - unsigned char __uc; \ - } *__u = __s; \ - __uint8_t __c = (__uint8_t) (c); \ - \ - /* This `switch' statement will be removed at compile-time. */ \ - switch ((unsigned int) (n)) \ - { \ - case 15: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 11: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 7: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 3: \ - __u->__usi = (unsigned short int) __c * 0x0101; \ - __u = __extension__ ((void *) __u + 2); \ - __u->__uc = (unsigned char) __c; \ - break; \ - \ - case 14: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 10: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 6: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 2: \ - __u->__usi = (unsigned short int) __c * 0x0101; \ - break; \ - \ - case 13: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 9: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 5: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 1: \ - __u->__uc = (unsigned char) __c; \ - break; \ - \ - case 16: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 12: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 8: \ - __u->__ui = __c * 0x01010101; \ - __u = __extension__ ((void *) __u + 4); \ - case 4: \ - __u->__ui = __c * 0x01010101; \ - case 0: \ - break; \ - } \ - \ - __s; }) -# else -# define memset(s, c, n) \ - (__extension__ (__builtin_constant_p (c) && (c) == '\0' \ - ? ({ void *__s = (s); __bzero (__s, n); __s; }) \ - : memset (s, c, n))) -# endif -# endif - /* GCC < 3.0 optimizes memset(s, 0, n) but not bzero(s, n). The optimization is broken before EGCS 1.1. GCC 3.0+ has __builtin_bzero as well, but at least till GCC 3.4 @@ -193,10 +83,8 @@ __STRING2_COPY_TYPE (8); # if __GNUC_PREREQ (2, 91) # define __bzero(s, n) __builtin_memset (s, '\0', n) # endif - #endif - /* Copy N bytes from SRC to DEST, returning pointer to byte following the last copied. */ #ifdef __USE_GNU @@ -204,35 +92,14 @@ __STRING2_COPY_TYPE (8); # ifndef _HAVE_STRING_ARCH_mempcpy # if __GNUC_PREREQ (3, 4) # define __mempcpy(dest, src, n) __builtin_mempcpy (dest, src, n) -# elif __GNUC_PREREQ (3, 0) -# define __mempcpy(dest, src, n) \ - (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ - && __string2_1bptr_p (src) && n <= 8 \ - ? __builtin_memcpy (dest, src, n) + (n) \ - : __mempcpy (dest, src, n))) -# else -# define __mempcpy(dest, src, n) \ - (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ - && __string2_1bptr_p (src) && n <= 8 \ - ? __mempcpy_small (dest, __mempcpy_args (src), n) \ - : __mempcpy (dest, src, n))) # endif /* In glibc we use this function frequently but for namespace reasons we have to use the name `__mempcpy'. */ # define mempcpy(dest, src, n) __mempcpy (dest, src, n) # endif -# if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES +# if defined _FORCE_INLINES # if _STRING_ARCH_unaligned -# ifndef _FORCE_INLINES -# define __mempcpy_args(src) \ - ((const char *) (src))[0], ((const char *) (src))[2], \ - ((const char *) (src))[4], ((const char *) (src))[6], \ - __extension__ __STRING2_SMALL_GET16 (src, 0), \ - __extension__ __STRING2_SMALL_GET16 (src, 4), \ - __extension__ __STRING2_SMALL_GET32 (src, 0), \ - __extension__ __STRING2_SMALL_GET32 (src, 4) -# endif __STRING_INLINE void *__mempcpy_small (void *, char, char, char, char, __uint16_t, __uint16_t, __uint32_t, __uint32_t, size_t); @@ -299,36 +166,6 @@ __mempcpy_small (void *__dest1, return (void *) __u; } # else -# ifndef _FORCE_INLINES -# define __mempcpy_args(src) \ - ((const char *) (src))[0], \ - __extension__ ((__STRING2_COPY_ARR2) \ - { { ((const char *) (src))[0], ((const char *) (src))[1] } }), \ - __extension__ ((__STRING2_COPY_ARR3) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2] } }), \ - __extension__ ((__STRING2_COPY_ARR4) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3] } }), \ - __extension__ ((__STRING2_COPY_ARR5) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4] } }), \ - __extension__ ((__STRING2_COPY_ARR6) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5] } }), \ - __extension__ ((__STRING2_COPY_ARR7) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - ((const char *) (src))[6] } }), \ - __extension__ ((__STRING2_COPY_ARR8) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - ((const char *) (src))[6], ((const char *) (src))[7] } }) -# endif __STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2, __STRING2_COPY_ARR3, __STRING2_COPY_ARR4, @@ -407,26 +244,8 @@ extern void *__rawmemchr (const void *__s, int __c); /* Copy SRC to DEST. */ -#if (!defined _HAVE_STRING_ARCH_strcpy && !__GNUC_PREREQ (3, 0)) \ - || defined _FORCE_INLINES -# if !defined _HAVE_STRING_ARCH_strcpy && !__GNUC_PREREQ (3, 0) -# define strcpy(dest, src) \ - (__extension__ (__builtin_constant_p (src) \ - ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \ - ? __strcpy_small (dest, __strcpy_args (src), \ - strlen (src) + 1) \ - : (char *) memcpy (dest, src, strlen (src) + 1)) \ - : strcpy (dest, src))) -# endif - +#if defined _FORCE_INLINES # if _STRING_ARCH_unaligned -# ifndef _FORCE_INLINES -# define __strcpy_args(src) \ - __extension__ __STRING2_SMALL_GET16 (src, 0), \ - __extension__ __STRING2_SMALL_GET16 (src, 4), \ - __extension__ __STRING2_SMALL_GET32 (src, 0), \ - __extension__ __STRING2_SMALL_GET32 (src, 4) -# endif __STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t, __uint32_t, __uint32_t, size_t); __STRING_INLINE char * @@ -482,35 +301,6 @@ __strcpy_small (char *__dest, return __dest; } # else -# ifndef _FORCE_INLINES -# define __strcpy_args(src) \ - __extension__ ((__STRING2_COPY_ARR2) \ - { { ((const char *) (src))[0], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR3) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR4) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR5) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR6) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR7) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR8) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - ((const char *) (src))[6], '\0' } }) -# endif __STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2, __STRING2_COPY_ARR3, __STRING2_COPY_ARR4, @@ -574,38 +364,14 @@ __strcpy_small (char *__dest, # ifndef _HAVE_STRING_ARCH_stpcpy # if __GNUC_PREREQ (3, 4) # define __stpcpy(dest, src) __builtin_stpcpy (dest, src) -# elif __GNUC_PREREQ (3, 0) -# define __stpcpy(dest, src) \ - (__extension__ (__builtin_constant_p (src) \ - ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \ - ? __builtin_strcpy (dest, src) + strlen (src) \ - : ((char *) (__mempcpy) (dest, src, strlen (src) + 1) \ - - 1)) \ - : __stpcpy (dest, src))) -# else -# define __stpcpy(dest, src) \ - (__extension__ (__builtin_constant_p (src) \ - ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \ - ? __stpcpy_small (dest, __stpcpy_args (src), \ - strlen (src) + 1) \ - : ((char *) (__mempcpy) (dest, src, strlen (src) + 1) \ - - 1)) \ - : __stpcpy (dest, src))) # endif /* In glibc we use this function frequently but for namespace reasons we have to use the name `__stpcpy'. */ # define stpcpy(dest, src) __stpcpy (dest, src) # endif -# if !__GNUC_PREREQ (3, 0) || defined _FORCE_INLINES +# if defined _FORCE_INLINES # if _STRING_ARCH_unaligned -# ifndef _FORCE_INLINES -# define __stpcpy_args(src) \ - __extension__ __STRING2_SMALL_GET16 (src, 0), \ - __extension__ __STRING2_SMALL_GET16 (src, 4), \ - __extension__ __STRING2_SMALL_GET32 (src, 0), \ - __extension__ __STRING2_SMALL_GET32 (src, 4) -# endif __STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t, __uint32_t, __uint32_t, size_t); __STRING_INLINE char * @@ -666,35 +432,6 @@ __stpcpy_small (char *__dest, return &__u->__c; } # else -# ifndef _FORCE_INLINES -# define __stpcpy_args(src) \ - __extension__ ((__STRING2_COPY_ARR2) \ - { { ((const char *) (src))[0], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR3) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR4) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR5) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR6) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR7) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - '\0' } }), \ - __extension__ ((__STRING2_COPY_ARR8) \ - { { ((const char *) (src))[0], ((const char *) (src))[1], \ - ((const char *) (src))[2], ((const char *) (src))[3], \ - ((const char *) (src))[4], ((const char *) (src))[5], \ - ((const char *) (src))[6], '\0' } }) -# endif __STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2, __STRING2_COPY_ARR3, __STRING2_COPY_ARR4, @@ -758,13 +495,6 @@ __stpcpy_small (char *__dest, #ifndef _HAVE_STRING_ARCH_strncpy # if __GNUC_PREREQ (3, 2) # define strncpy(dest, src, n) __builtin_strncpy (dest, src, n) -# else -# define strncpy(dest, src, n) \ - (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ - ? (strlen (src) + 1 >= ((size_t) (n)) \ - ? (char *) memcpy (dest, src, n) \ - : strncpy (dest, src, n)) \ - : strncpy (dest, src, n))) # endif #endif @@ -782,13 +512,6 @@ __stpcpy_small (char *__dest, : strncat (dest, src, n); })) # elif __GNUC_PREREQ (3, 2) # define strncat(dest, src, n) __builtin_strncat (dest, src, n) -# else -# define strncat(dest, src, n) \ - (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ - ? (strlen (src) < ((size_t) (n)) \ - ? strcat (dest, src) \ - : strncat (dest, src, n)) \ - : strncat (dest, src, n))) # endif #endif @@ -815,27 +538,6 @@ __stpcpy_small (char *__dest, ? __builtin_strcmp (s1, s2) \ : __strcmp_gc (s1, s2, __s2_len)) \ : __builtin_strcmp (s1, s2)))); }) -# else -# define strcmp(s1, s2) \ - __extension__ \ - ({ size_t __s1_len, __s2_len; \ - (__builtin_constant_p (s1) && __builtin_constant_p (s2) \ - && (__s1_len = strlen (s1), __s2_len = strlen (s2), \ - (!__string2_1bptr_p (s1) || __s1_len >= 4) \ - && (!__string2_1bptr_p (s2) || __s2_len >= 4)) \ - ? memcmp ((const char *) (s1), (const char *) (s2), \ - (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) \ - : (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \ - && (__s1_len = strlen (s1), __s1_len < 4) \ - ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \ - ? __strcmp_cc (s1, s2, __s1_len) \ - : __strcmp_cg (s1, s2, __s1_len)) \ - : (__builtin_constant_p (s2) && __string2_1bptr_p (s2) \ - && (__s2_len = strlen (s2), __s2_len < 4) \ - ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1) \ - ? __strcmp_cc (s1, s2, __s2_len) \ - : __strcmp_gc (s1, s2, __s2_len)) \ - : strcmp (s1, s2)))); }) # endif # define __strcmp_cc(s1, s2, l) \ @@ -924,21 +626,6 @@ __stpcpy_small (char *__dest, ? __strcspn_c3 (s, __r0, __r1, __r2) \ : __builtin_strcspn (s, reject)))))) \ : __builtin_strcspn (s, reject)); }) -# else -# define strcspn(s, reject) \ - __extension__ \ - ({ char __r0, __r1, __r2; \ - (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \ - ? ((__r0 = ((const char *) (reject))[0], __r0 == '\0') \ - ? strlen (s) \ - : ((__r1 = ((const char *) (reject))[1], __r1 == '\0') \ - ? __strcspn_c1 (s, __r0) \ - : ((__r2 = ((const char *) (reject))[2], __r2 == '\0') \ - ? __strcspn_c2 (s, __r0, __r1) \ - : (((const char *) (reject))[3] == '\0' \ - ? __strcspn_c3 (s, __r0, __r1, __r2) \ - : strcspn (s, reject))))) \ - : strcspn (s, reject)); }) # endif # endif @@ -1000,21 +687,6 @@ __strcspn_c3 (const char *__s, int __reject1, int __reject2, ? __strspn_c3 (s, __a0, __a1, __a2) \ : __builtin_strspn (s, accept)))))) \ : __builtin_strspn (s, accept)); }) -# else -# define strspn(s, accept) \ - __extension__ \ - ({ char __a0, __a1, __a2; \ - (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \ - ? ((__a0 = ((const char *) (accept))[0], __a0 == '\0') \ - ? ((void) (s), (size_t) 0) \ - : ((__a1 = ((const char *) (accept))[1], __a1 == '\0') \ - ? __strspn_c1 (s, __a0) \ - : ((__a2 = ((const char *) (accept))[2], __a2 == '\0') \ - ? __strspn_c2 (s, __a0, __a1) \ - : (((const char *) (accept))[3] == '\0' \ - ? __strspn_c3 (s, __a0, __a1, __a2) \ - : strspn (s, accept))))) \ - : strspn (s, accept)); }) # endif # endif @@ -1076,21 +748,6 @@ __strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3) ? __strpbrk_c3 (s, __a0, __a1, __a2) \ : __builtin_strpbrk (s, accept)))))) \ : __builtin_strpbrk (s, accept)); }) -# else -# define strpbrk(s, accept) \ - __extension__ \ - ({ char __a0, __a1, __a2; \ - (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \ - ? ((__a0 = ((const char *) (accept))[0], __a0 == '\0') \ - ? ((void) (s), (char *) NULL) \ - : ((__a1 = ((const char *) (accept))[1], __a1 == '\0') \ - ? strchr (s, __a0) \ - : ((__a2 = ((const char *) (accept))[2], __a2 == '\0') \ - ? __strpbrk_c2 (s, __a0, __a1) \ - : (((const char *) (accept))[3] == '\0' \ - ? __strpbrk_c3 (s, __a0, __a1, __a2) \ - : strpbrk (s, accept))))) \ - : strpbrk (s, accept)); }) # endif # endif @@ -1119,21 +776,6 @@ __strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3) #endif -/* Find the first occurrence of NEEDLE in HAYSTACK. Newer gcc versions - do this itself. */ -#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97) -# define strstr(haystack, needle) \ - (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \ - ? (((const char *) (needle))[0] == '\0' \ - ? (char *) (size_t) (haystack) \ - : (((const char *) (needle))[1] == '\0' \ - ? strchr (haystack, \ - ((const char *) (needle))[0]) \ - : strstr (haystack, needle))) \ - : strstr (haystack, needle))) -#endif - - #if !defined _HAVE_STRING_ARCH_strtok_r || defined _FORCE_INLINES # ifndef _HAVE_STRING_ARCH_strtok_r # define __strtok_r(s, sep, nextp) \