Closed
Description
Rust nightly version 2018-02-11
broke some inline assembly in code that previously worked.
Specifically, the jmp instruction on x86_64 doesn't work as it has before.
A minimum example to reproduce is that
fn foo(bytes: &[u8]) -> u32 {
let result: u32;
unsafe {
asm!(
"
1:
jmp 1b
"
: "={ax}"(result) // Output register
: "r"(bytes.as_ptr()), "r"(bytes.len()) // Input registers
: "rax" // Clobbered registers
: "intel", "volatile" // Options (intel syntax, don't optimize out)
);
}
result
}
now fails to compile with error:
error: <inline asm>:5:2: error: invalid operand for instruction jmp 1b
The code snippet above compiles with rust-nightly-x86_64-unknown-linux-gnu nightly 2018-02-10
and earlier, but returns an error on nightly 2018-02-11
and beyond. I tried looking through the commits that happened that day but couldn't find the exact source of the issue.