https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95076
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Richard Biener from comment #1) > GCC doesn't tail-call because the return types are not compatible. With a > call > it cannot optimize the stack adjustment because of the ABI. > > Note I'm not sure whether the ABI allows %rax to contain "garbage" in the > upper half for a function returning in %eax. So what LLVM does may be wrong. Don't upper bits of %rax in GCC generate code also contain garbage?