This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51571] No named return value optimization while adding a dummy scope
- From: "marc at kdab dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Feb 2015 22:40:49 +0000
- Subject: [Bug c++/51571] No named return value optimization while adding a dummy scope
- Auto-submitted: auto-generated
- References: <bug-51571-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51571
marc at kdab dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marc at kdab dot com
--- Comment #4 from marc at kdab dot com ---
I would like to strongly oppose the notion that this "just a missed
optimisation and not very critical, really".
NRVO is not just "an optimisation". It's actually one that is explcitly
permitted to change observable behaviour of the program and it's extremely
powerful.
And it it _required_ for performant C++. Just try to return a std::vector by
value to see the importance of this optimisation. This is not missed
optimisation. This is premature pessimisation.
You could just as well stop all optimisation work for the C++ frontend until
this is implemented, because any other optimisation effords are dwarfed by the
overhead when NRVO is expected by the developer but not applied.
Please make this a top priority. Every C++ program will benefit both in text
size and in runtime performance - dramatically.