Skip to content

compiler abort in LLVM code when using a newtype-wrapper as an argument #15402

Closed
@TethysSvensson

Description

@TethysSvensson

The following program will cause an abort in llvm/lib/IR/InlineAsm.cpp:

#![feature(asm)]

pub struct Wrapper(uint);

fn main() {
    let mut value: Wrapper = Wrapper(7);
    unsafe {
        asm!("mov %eax, $0" : "+r"(value));
    }
}

The error message I get is:

rustc: /build/buildd/rust-nightly-201407030406~67776ba~utopic/src/llvm/lib/IR/InlineAsm.cpp:47: llvm::InlineAsm::InlineAsm(llvm::PointerType*, const string&, const string&, bool, bool, llvm::InlineAsm::AsmDialect): Assertion `Verify(getFunctionType(), constraints) && "Function type not legal for constraints!"' failed.
Aborted (core dumped)

I am using the rust nightly build version 20140703040667776bautopic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityglacierICE tracked in rust-lang/glacier.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