Skip to content

amdgcn-amd-amdhsa target broken? Fails to build core #148514

@ZuseZ4

Description

@ZuseZ4

I tried this code:

#![no_std]
fn foo() {}

with
RUSTFLAGS="-Ctarget-cpu=gfx1103 --emit=llvm-bc,llvm-ir" cargo +offload build -Zunstable-options -r -v --target amdgcn-amd-amdhsa -Zbuild-std=core
(As a tier 3 target, build-std is mandatory).

I expected to see this happen: compiles

Instead, this happened:
It fails to compile core:

rustc: /home/manuel/prog/rust_gpu/src/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9502: SDValue llvm::SelectionDAG::getLoad(ISD::MemIndexedMode, ISD::LoadExtType, EVT, const SDLoc &, SDValue, SDValue, SDValue, EVT, MachineMemOperand *): Assertion `(!MMO->getRanges() || (mdconst::extract<ConstantInt>(MMO->getRanges()->getOperand(0)) ->getBitWidth() == MemVT.getScalarSizeInBits() && MemVT.isInteger())) && "Range metadata and load type must match!"' failed.

This is not reproducible on nightly, which doesn't seem surprising given: https://rustc-dev-guide.rust-lang.org/backend/debugging.html?highlight=llvm-assertions#enable-llvm-internal-checks

Meta

rustc --version --verbose:

latest master, build from source

cc @Flakebi

Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-amdgcnTarget: the Radeon 9001XT and such

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions