Skip to content

Inline assembly disappears from output #26648

Closed

Description

@uzytkownik

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.

Activity

  1. eefriedman commented on Jun 29, 2015

    @eefriedman
    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.

  2. uzytkownik commented on Jul 2, 2015

    @uzytkownik
    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.

  3. jethrogb commented on Jan 14, 2016

    @jethrogb
    Contributor

    Referencing #22892

  4. jethrogb commented on Apr 28, 2017

    @jethrogb
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions