https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114088
--- Comment #4 from Jonathan Wakely ---
(In reply to Xi Ruoyao from comment #2)
> But __builtin_strlen *does* get optimized when the input is a string
> literal.
But so does strlen, because GCC knows about it. That's my point.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114088
--- Comment #3 from Thiago Macieira ---
> But __builtin_strlen *does* get optimized when the input is a string literal.
> Not sure about wcslen though.
It appears not to, in the test above. std::char_trait::length() calls
wcslen() whereas
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114088
Xi Ruoyao changed:
What|Removed |Added
CC||xry111 at gcc dot gnu.org
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114088
--- Comment #1 from Jonathan Wakely ---
GCC built-ins like __builtin_strlen just wrap a libc function. __builtin_wcslen
would generally just be a call to wcslen, which doesn't give you much. I assume
what you want is to recognize wcslen and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114088
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement