https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95076
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Failure to optimize out |Failure to tail-call on |stack alignment on function |function call of different |call of different type on |return type |x86 | CC| |hjl.tools at gmail dot com Target| |x86_64-*-* i?86-*-* --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- 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.