This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/59048] std::string operator== between std::string and const char* creates unecessary temporary object
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Nov 2013 19:23:47 +0000
- Subject: [Bug libstdc++/59048] std::string operator== between std::string and const char* creates unecessary temporary object
- Auto-submitted: auto-generated
- References: <bug-59048-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59048
--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
memcmp is pure and gcc manages to pull it out of the loop (see the file created
by -fdump-tree-optimized). It is funny that -fno-builtin-strcmp makes the code
more than 2 times faster (the main difference I can see is using "repz cmpsb"
instead of a call to the libc function strcmp).