It seems like bug in LLVM generator. Code ``` rust let rip: u64; asm!("movq %rip, %rax" : "={rax}"(rip) ::: "volatile"); ``` Produces correct LLVM IR: ``` %46 = call i64 asm sideeffect "movq %rip, %rax", "={rax},~{dirflag},~{fpsr},~{flags}"(), !dbg !4561, !srcloc !4562 ``` But the output sometimes does not contain the instruction and the value of `rip` is `0x1d1d1d1d1d1d1d1d`.
Activity
eefriedman commentedon Jun 29, 2015
Umm, I think you meant to write "leaq (%rip), %rax"? You can't MOV out of RIP.
It's probably a bug that LLVM doesn't reject it, though.
uzytkownik commentedon Jul 2, 2015
It looks like this is issue 22892 after all.
Yes, I just didn't remembered that I cannot.
jethrogb commentedon Jan 14, 2016
Referencing #22892
jethrogb commentedon Apr 28, 2017
This issue can be closed, fixed in nightly: https://is.gd/Q3RvxB