Skip to content

PR for llvm/llvm-project#62694 #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2023
Merged

PR for llvm/llvm-project#62694 #443

merged 1 commit into from
May 16, 2023

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented May 13, 2023

The x86_intrcc calling convention will build two STACKALLOC_W_PROBING machine instructions if the function takes an error code. This is caused by an additional call to emitSPUpdate in llvm/lib/Target/X86/X86FrameLowering.cpp:1650. Previously only the first STACKALLOC_W_PROBING machine instruction was properly handled, the second one was simply ignored. This lead to miscompilations where the stack pointer wasn't properly updated (see rust-lang/rust#109918). This patch fixes this by handling all STACKALLOC_W_PROBING machine instructions.

To be honest I don't quite understand why this didn't lead to more noticeable miscompilations previously.

This is my first time contributing to LLVM.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D150033

(cherry picked from commit f615436)
@llvmbot
Copy link
Member Author

llvmbot commented May 13, 2023

@phoebewang What do you think about merging this PR to the release branch?

@phoebewang
Copy link
Contributor

I don't see any risk to merge this. LGTM.

@tstellar tstellar merged commit df309b1 into release/16.x May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backport fix for x86_intrcc with stack probing
4 participants