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/77938] missing tailcall optimization in case when local variable escapes


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?

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