Stream: git-wasmtime

Topic: wasmtime / issue #14693 Cranelift: miscompile on aarch64 ...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2026 at 01:46):

Takashiidobe opened issue #14693:

.clif Test Case

function %cas_i32_junk_upper_bits(i64) -> i32 {
    ss0 = explicit_slot 4
block0(v0: i64):
    v1 = iconst.i32 7
    v2 = stack_addr.i64 ss0
    store.i32 v1, v2
    v3 = ireduce.i32 v0
    v4 = iconst.i32 9
    v5 = atomic_cas.i32 v2, v3, v4
    v6 = load.i32 v2
    return v6
}

Steps to Reproduce

Expected Results

this should return 9

Actual Results

this returns 7

Versions and Environment

Cranelift version or commit: 0.136.2

Operating system: linux

Architecture: x86_64 emulating aarch64 with qemu

Extra Info

link to this in my clif tool

This is similar to https://github.com/bytecodealliance/wasmtime/issues/14691 where after an ireduce an op still reads the top bits.

I believe this just requires special casing for i32 like i8 and i64 do as well in aarch64/inst/emit.rs around line 1985.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2026 at 01:46):

Takashiidobe added the bug label to Issue #14693.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2026 at 01:46):

Takashiidobe added the cranelift label to Issue #14693.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2026 at 14:33):

alexcrichton added the cranelift:area:aarch64 label to Issue #14693.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2026 at 14:34):

alexcrichton commented on issue #14693:

cc https://github.com/bytecodealliance/wasmtime/pull/14525

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2026 at 18:24):

cfallin closed issue #14693:

.clif Test Case

function %cas_i32_junk_upper_bits(i64) -> i32 {
    ss0 = explicit_slot 4
block0(v0: i64):
    v1 = iconst.i32 7
    v2 = stack_addr.i64 ss0
    store.i32 v1, v2
    v3 = ireduce.i32 v0
    v4 = iconst.i32 9
    v5 = atomic_cas.i32 v2, v3, v4
    v6 = load.i32 v2
    return v6
}

Steps to Reproduce

Expected Results

this should return 9

Actual Results

this returns 7

Versions and Environment

Cranelift version or commit: 0.136.2

Operating system: linux

Architecture: x86_64 emulating aarch64 with qemu

Extra Info

link to this in my clif tool

This is similar to https://github.com/bytecodealliance/wasmtime/issues/14691 where after an ireduce an op still reads the top bits.

I believe this just requires special casing for i32 like i8 and i64 do as well in aarch64/inst/emit.rs around line 1985.


Last updated: Oct 31 2026 at 23:03 UTC