Skip to content

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

Closed
@emberian

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.

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions