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

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Nov 26 21:55:00 GMT 2017


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #4)
> 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.

data is not taken as an address except in the equals so it cannot be the same
as the global variable pointer.  And using ptest after data goes out of scope
in footest is undefined code.

So the difference is just based on undefined code.


More information about the Gcc-bugs mailing list