GLIBC uses strchr (s, '\0') as an idiom to find the end of a string.
commit40b7fbf27310d4f4a899aa2c54740dce5369ec70
authorWilco Dijkstra <wdijkstr@arm.com>
Fri, 10 Feb 2017 17:26:16 +0000 (10 17:26 +0000)
committerWilco Dijkstra <wdijkstr@arm.com>
Fri, 10 Feb 2017 17:28:11 +0000 (10 17:28 +0000)
treedf78f63943d48a7e7af1718d1db7b8229044a2f1
parent3403a17fea8ccef7dc5f99553a13231acf838744
GLIBC uses strchr (s, '\0') as an idiom to find the end of a string.
This is transformed into rawmemchr by the bits/string2.h header.
However this is generally slower than strlen on most targets, even when
an optimized rawmemchr implementation exists.  Since GCC7 optimizes
strchr (s, '\0') to strlen (s) + s, the GLIBC headers should not
transform this to rawmemchr.  As GCC recognizes strchr as a builtin,
defining strchr as the builtin is not useful.

* string/bits/string2.h (strchr): Remove define.
ChangeLog
string/bits/string2.h