Skip to content

Cranelift: band_not triggers assertion left == right failed on aarch64 #12171

@abc767234318

Description

@abc767234318

.clif Test Case

test run

set enable_nan_canonicalization=true
set preserve_frame_pointers=true
set enable_multi_ret_implicit_sret=true
set opt_level=none

target x86_64 sse42 has_avx
target aarch64
target s390x
target riscv64gc has_zcd has_zbkb has_zbc has_zbs has_zicond has_zvl32b has_zvl64b has_zvl128b has_zvl1024b has_zvl2048b has_zvl4096b has_zvl8192b has_zvl16384b has_zvl32768b
function %main() -> f64 fast {

block0:
    v2 = f64const 0.0
    v5 = iconst.i32 -428912370
    v11 = f64const 0x1.fffffffffffffp1023
    v22 = iconst.i32 0
    v39 = band_not v11, v2  ; v11 = 0x1.fffffffffffffp1023, v2 = 0.0
    return v39
}


; print: %main()

Steps to Reproduce

I ran this test case using the following command and it crashed on the aarch64 platform. However, this phenomenon did not appear on other platforms such as x86_64 and riscv64.

qemu-aarch64 -L /usr/aarch64-linux-gnu clif-util run -v ./test.clif

Expected Results

%main() -> 0x1.fffffffffffffp1023

Actual Results

thread 'main' panicked at cranelift/codegen/src/isa/aarch64/inst/emit.rs:97:5:
assertion `left == right` failed
  left: Float
 right: Int

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions