Skip to content

LLVM assertion: Can only indirectify direct input operands! #29382

Closed
@Amanieu

Description

@Amanieu

The following code triggers an LLVM assert:

#![feature(asm)]
unsafe fn test(x: *mut u32) {
    asm!("": "=m" (*x));
}
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6012: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `(OpInfo.isMultipleAlternative || (OpInfo.Type == InlineAsm::isInput)) && "Can only indirectify direct input operands!"' failed.

One thing of note in the LLVM output is this line:

%5 = call i32 asm "", "=m,~{dirflag},~{fpsr},~{flags}"(), !dbg !199, !srcloc !201

Note that the operand to the asm is left empty for some reason, which is probably wrong.

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-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE 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