Skip to content
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

Inline assembly disappears from output #26648

Closed
uzytkownik opened this issue Jun 29, 2015 · 4 comments
Closed

Inline assembly disappears from output #26648

uzytkownik opened this issue Jun 29, 2015 · 4 comments
Labels
A-inline-assembly Area: inline asm!(..)

Comments

@uzytkownik
Copy link

It seems like bug in LLVM generator. Code

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.

@huonw huonw added the A-inline-assembly Area: inline asm!(..) label Jun 29, 2015
@eefriedman
Copy link
Contributor

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
Copy link
Author

It looks like this is issue 22892 after all.

Umm, I think you meant to write "leaq (%rip), %rax"? You can't MOV out of RIP.

Yes, I just didn't remembered that I cannot.

@jethrogb
Copy link
Contributor

Referencing #22892

@jethrogb
Copy link
Contributor

jethrogb commented Apr 28, 2017

This issue can be closed, fixed in nightly: https://is.gd/Q3RvxB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: inline asm!(..)
Projects
None yet
Development

No branches or pull requests

5 participants