Open TDecking opened 2 years ago
@rustbot label +A-inline-assembly +T-compiler
This appears to be an LLVM bug, the inline asm makes it all the way to LLVM correctly, and manually passing this inline asm to LLVM emits this invalid asm. Not sure what the process for this is.
Reported upstream at https://github.com/llvm/llvm-project/issues/96427
The following code
creates the following assembly
Note that
[rax - 8 * rdx]
turned into[rax + 8*rdx]
. The former version is illegal, since registers can only be added, not subtracted when calculating an address. Given that gcc rejects a similar attempt with its inline assembly, as well as the general confusion anyone uninitiated to the specifics oflea
might get, I highly doubt that this behaviour is intentional.Meta
Godbolt printed the same assembly for rustc versions 1.59, 1.60, 1.61, beta and nightly.