This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/82000] Missed optimization of char_traits::length() on constant string


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]