[llvm] x86: fix musttail sibcall miscompilation (PR #168956)

Folkert de Vries via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 11:55:42 PST 2025


================

----------------
folkertdev wrote:

this is due to using `canGuaranteeTCO` in the definition of `ShouldGuaranteeTCO`.

```c
/// Return true if the calling convention is one that we can guarantee TCO for.
static bool canGuaranteeTCO(CallingConv::ID CC) {
  return (CC == CallingConv::Fast || CC == CallingConv::GHC ||
          CC == CallingConv::X86_RegCall || CC == CallingConv::HiPE ||
          CC == CallingConv::Tail || CC == CallingConv::SwiftTail);
}
```

https://github.com/llvm/llvm-project/pull/168956


More information about the llvm-commits mailing list