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 tree-optimization/70804] Missed tail-call


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.

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