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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Tailcall optimization is not applicable here: while E::destroy is running, the
object must still be live (and the body of E::destroy is unavailable, so GCC
can't know if it inspects the object or not).

But if you're making a tailcall from f to E::destroy, you're invoking
E::destroy after the lifetime of b has ended. E::destroy accepts a pointer to
the object ('this'), but if you'd be making a tailcall, the 'this' you'd be
passing would point to just-deallocated f's stack frame.

Reply via email to