This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53637] NRVO not applied in branches when it could be
- 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:28:49 +0000
- Subject: [Bug c++/53637] NRVO not applied in branches when it could be
- Auto-submitted: auto-generated
- References: <bug-53637-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53637
marc at kdab dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marc at kdab dot com
--- Comment #1 from marc at kdab dot com ---
Similar situation in
https://codereview.qt-project.org/#/c/104079/1/src/network/ssl/qsslellipticcurve_openssl.cpp,unified
(click on the comment in line 61 to see GCC 4.9.3 (from svn) disassembly.
Qt is full of functions structured like that and it's not an option to rewrite
them all.
Lawrence Crowl calls (N)RVO the most important optimisation in C++, and it's
really sad that GCC doesn't apply NRVO even in those cases where there is only
one possible object returned per basic block, ie. where the compiler knows
which object will be returned by at the time of construction of each object.
It's even more sad that this report has been sitting here, unconfirmed and
ignored by the GCC developers, for 19 months.