-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Incorrect handling of lateout pairs in inline asm #57550
Labels
Comments
@newpavlov Please attach LLVM IR that could be used to reproduce the issue. Thanks! |
https://llvm.godbolt.org/z/qxrfd7fj3 define i32 @foo() unnamed_addr #0 {
start:
%0 = tail call { i32, i32 } asm inteldialect "mov ${0:k}, 1\0Amov eax, 42", "=r,={ax},~{dirflag},~{fpsr},~{flags}"() #1, !srcloc !2
%1 = extractvalue { i32, i32 } %0, 0
ret i32 %1
}
!0 = !{i32 7, !"PIC Level", i32 2}
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
!2 = !{i32 0, i32 108, i32 136} |
Just to be clear, the problem here is that with an It looks like we originally get a correct allocation to
|
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue was discovered while looking into source of rust-lang/rust#101346.
The following Rust function:
Gets compiled into this obviously incorrect assembly:
Godbolt link: https://rust.godbolt.org/z/Yb9v7WobM
LLVM incorrectly reuses register for a pair of
lateout
s if it can see that one of those does not get used later.The text was updated successfully, but these errors were encountered: