-
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
x86 asm!
accepts "lock" as a standalone instruction
#82314
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
F-asm
`#![feature(asm)]` (not `llvm_asm`)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
F-asm
`#![feature(asm)]` (not `llvm_asm`)
labels
Feb 20, 2021
It seems like a pretty esoteric case, and also hard to prevent in the general case. |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 4, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Nov 5, 2021
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes rust-lang#82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
C-bug
Category: This is a bug.
F-asm
`#![feature(asm)]` (not `llvm_asm`)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This is not rejected, and, according to objdump, results in the following assembly (when optimizations are on):
I'd expect this to result in an error, since
lock
by itself isn't a valid instruction (it doesn't really seem desirable to letasm!()
affect how rustc-produced instructions are decoded).The text was updated successfully, but these errors were encountered: