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

2022-06-05 Thread glisse at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #10 from Marc Glisse --- (In reply to AK from comment #9) > can't repro this with gcc 12.1 Seems like this is fixed? No. As stated in other comments, it still reproduces with a longer string (or with -D_GLIBCXX_USE_CXX11_ABI=0).

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

2022-06-04 Thread hiraditya at msn dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #9 from AK --- can't repro this with gcc 12.1 Seems like this is fixed? https://godbolt.org/z/e6n94zK4E

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

2022-01-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #8 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #7) > With -std=c++20 -O2 I get better code than just -std=c++17 -O2: > _34 = operator new (24); > __builtin_memcpy (_34, "a ", 23); >

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

2022-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #7 from Andrew Pinski --- With -std=c++20 -O2 I get better code than just -std=c++17 -O2: _34 = operator new (24); __builtin_memcpy (_34, "a ", 23); MEM[(char_type &)_34 + 23] = 0; operator delete (_34,

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

2022-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2022-01-07 Resolution|DUPLICATE

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

2020-01-21 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Bug 80331 depends on bug 23383, which changed state. Bug 23383 Summary: builtin array operator new is not marked with malloc attribute https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23383 What|Removed |Added

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

2017-04-05 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Markus Trippelsdorf changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

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

2017-04-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Andrew Pinski changed: What|Removed |Added Depends on||23383 --- Comment #4 from Andrew Pinski

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

2017-04-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #3 from Marc Glisse --- (In reply to Marc Glisse from comment #2) > I didn't check if those are the only blockers in this case... Looks like they are indeed the only blockers, since we optimize the below just fine. So, known issue

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

2017-04-05 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #2 from Marc Glisse --- 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

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

2017-04-05 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Markus Trippelsdorf changed: What|Removed |Added CC||trippels at gcc dot gnu.org ---