This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/70804] Missed tail-call
- From: "amonakov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 27 Apr 2016 10:38:19 +0000
- Subject: [Bug tree-optimization/70804] Missed tail-call
- Auto-submitted: auto-generated
- References: <bug-70804-4 at http dot gcc dot gnu dot org/bugzilla/>
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.