From patchwork Fri Nov 18 15:37:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 17564 Received: (qmail 66671 invoked by alias); 18 Nov 2016 15:38:15 -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 66533 invoked by uid 89); 18 Nov 2016 15:38:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1446, Hx-languages-length:1995 X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com From: Wilco Dijkstra To: "libc-alpha@sourceware.org" CC: nd Subject: [PATCH] Remove defines to builtins in string2.h Date: Fri, 18 Nov 2016 15:37:59 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2611; 7:HUzSDK3fFX8VZ4/Yd+qYsbg8cDn5L2LlxuAZjgDzYtETeXNFOwcxhYlqgKdzIWHTt7zOxE3/Mjn5GCMuX3vuLw54wWfQnaLJDvB7TPWNTzpOgnDHObiH4Us/O4SSO9NOdMbUkfXXSdJYn6JZiTWzvULN+XELtMX3ZRHRWVFDpS/e9qAtvfc2s08u0quZ03YO2t+sD2sXHOKDxY/+FBB9r7xH0uOPbWgrg6MOhiXdUZ7rfg7I3fVFadyOuPz7eYpN7QH5xrnF3f9H9MuiWqxf75COo6hXgC1n06+qW/K2hKkPf+60HIqo9Nuen4tuc2fsQBpafPN+CKQkMa/W7AujxFfSFDcoElPaL/71rz4dp6k= x-ms-office365-filtering-correlation-id: 8060790b-9a32-4b04-ea88-08d40fc8e096 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM5PR0802MB2611; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040281)(6060326)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041223)(6061324); SRVR:AM5PR0802MB2611; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2611; x-forefront-prvs: 01304918F3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(54534003)(377424004)(189002)(199003)(2501003)(5640700001)(54356999)(76576001)(74316002)(86362001)(7736002)(3280700002)(105586002)(305945005)(106356001)(7846002)(50986999)(6506003)(101416001)(5660300001)(106116001)(8676002)(3660700001)(3846002)(2351001)(102836003)(6116002)(450100001)(92566002)(6916009)(4001150100001)(122556002)(33656002)(4326007)(68736007)(66066001)(7696004)(2906002)(110136003)(189998001)(87936001)(81156014)(97736004)(2900100001)(81166006)(9686002)(8936002)(77096005)(38730400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2611; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2016 15:37:59.9623 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2611 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 * string/bits/string2.h (strchr) Remove define. (strncpy): Likewise. (strcspn): Likewise. (strspn): Likewise. (strpbrk): Likewise. 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)