Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix stack update for x86_intrcc with error code
Previously the x86_intrcc calling convention built two STACKALLOC_W_PROBING machine instructions if the function took an error code. This was caused by an additional call to emitSPUpdate in llvm/lib/Target/X86/X86FrameLowering.cpp:1650. The code for inlining the stack probes only handles the first STACKALLOC_W_PROBING machine instruction and ignores any futher `STACKALLOC_W_PROBING` instructions. This lead to miscompilations where the stack pointer wasn't properly updated (see rust-lang/rust#109918). This patch prevents a second STACKALLOC_W_PROBING instruction from being built by hard-coding the stack update to `push rax`. To be honest I don't quite understand why this didn't lead to more noticeable miscompilations previously.
- Loading branch information