Skip to content

LLVM assertion with asm! output constraint for "d" on x86 and x86_64 #28587

Description

@emberian
#![feature(asm)]

fn main() {
    let a: usize;

    unsafe {
        asm!("" : "=d"(a) : : : );
    }
}
vagrant@vagrant-ubuntu-trusty-64:~$ rustc reg-repro.rs 
reg-repro.rs:4:9: 4:10 warning: variable `a` is assigned to, but never used, #[warn(unused_variables)] on by default
reg-repro.rs:4     let a: usize;
                       ^
reg-repro.rs:7:24: 7:25 warning: value assigned to `a` is never read, #[warn(unused_assignments)] on by default
reg-repro.rs:7         asm!("" : "=d"(a) : : : );
                                      ^
note: in expansion of asm!
reg-repro.rs:7:9: 7:35 note: expansion site
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h:169: unsigned int llvm::FunctionLoweringInfo::InitializeRegForValue(const llvm::Value*): Assertion `R == 0 && "Already initialized this value register!"' failed.

Activity

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!(…)`)C-bugCategory: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions