[Bug middle-end/83169] Optimizer doesn't correctly handle NRVO if -fno-inline-small-functions or function uninlinable

ibuclaw at gdcproject dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 26 21:52:00 GMT 2017


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

--- Comment #4 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to Jakub Jelinek from comment #3)
> NRVO in the middle-end is solely an optimization.  If some FE requires
> something above that, then it needs to do it itself, C++ is an example of a
> FE that does it.

If that's the case, then why the different runtime behaviours?

The generated code sets the address of the constructed variable the same the as
the return address, yet the condition is assumed false by the optimizer.


More information about the Gcc-bugs mailing list