[Bug libstdc++/80331] unused const std::string not optimized away

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 5 17:03:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
If you replace "a" with something longer (size>16 when counting the last '\0'),
it does reproduce. I'd say this is a dup of 2 known issues:
- the compiled part of libstdc++ prevents optimization (maybe eventually with
LTO?),
- gcc knows about malloc and free but not about new and delete.

I didn't check if those are the only blockers in this case...


More information about the Gcc-bugs mailing list