Skip to content

Assertion error on arm-unknown-linux-gnueabihf for maximum/minimum float #141087

Open
@ehuss

Description

@ehuss

I tried this code:

#![feature(float_minimum_maximum)]
fn main() {
    let x = 1.0_f64;
    let y = 2.0_f64;
    assert_eq!(x.maximum(y), y);
}

Building for target arm-unknown-linux-gnueabihf.

I expected to see this happen: Compiles

Instead, this happened: Compiler error:

rustc: /checkout/src/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:973: void (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(SDNode *): Assertion `(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) == TargetLowering::TypeLegal || Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) && "Unexpected illegal type!"' failed.
Aborted

cc Tracking issue #91079, which has some discussion of whether or not this should be implemented using an intrinsic, which I was a little unclear about or whether this limitation is known.

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (414482f6a 2025-05-13)
binary: rustc
commit-hash: 414482f6a0d4e7290f614300581a0b55442552a3
commit-date: 2025-05-13
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-floating-pointArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-libsRelevant to the library team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions