This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/77938] missing tailcall optimization in case when local variable escapes
- From: "vanyacpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 11 Oct 2016 17:05:11 +0000
- Subject: [Bug tree-optimization/77938] missing tailcall optimization in case when local variable escapes
- Auto-submitted: auto-generated
- References: <bug-77938-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77938
--- Comment #1 from Ivan Sorokin <vanyacpp at gmail dot com> ---
The generated code for caller is the following:
caller():
sub rsp, 24
lea rdi, [rsp+12]
call escape(int&)
call callee()
add rsp, 24
ret
As you can see callee() is the regular call, not a jump.
P.S. Another strange thing is that the stack frame for this function is much
bigger than I expected (24 instead of 8). I'm not a expert in the ABI, is it
the expected behavior?