This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82000] Missed optimization of char_traits::length() on constant string
- From: "ldionne.2 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 02:56:13 +0000
- Subject: [Bug c++/82000] Missed optimization of char_traits::length() on constant string
- Auto-submitted: auto-generated
- References: <bug-82000-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82000
--- Comment #2 from Louis Dionne <ldionne.2 at gmail dot com> ---
> The example you wrote in the bug report makes no sense: missing includes, and with the includes added it optimizes to return 0.
Sorry, I did not mean the example I pasted here to be a complete reproduction;
I just wanted explain the gist of what the godbolt link does.
> Downloading the one from godbolt, we simplify it to: [...]
I have no idea what this is and how you feed that to GCC, but I'm curious.
> (btw, why do you use "g" for clang and not for gcc?)
I copy pasted from
https://github.com/google/benchmark/blob/a271c36/include/benchmark/benchmark.h#L302.