This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53637] NRVO not applied in branches when it could be


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]