llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.85k stars 11.02k forks source link

Tailcall optimization and register preservation produces miscompile #97758

Open gerben-stavenga opened 6 days ago

gerben-stavenga commented 6 days ago

Tailcall optimization moves call out of the push/pop scope to preserve registers

https://godbolt.org/z/1zdnK96z6

llvmbot commented 5 days ago

@llvm/issue-subscribers-backend-x86

Author: None (gerben-stavenga)

Tailcall optimization moves call out of the push/pop scope to preserve registers https://godbolt.org/z/1zdnK96z6
gerben-stavenga commented 3 days ago

Btw. It's not only that it moves the call out of push/pop scope. It also doesn't set up the registers properly it misses the 3rd argument in rdx