Stream: git-wasmtime

Topic: wasmtime / PR #14712 aarch64: fix atomic_cas.i32 miscompi...


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

biggdawg320 opened PR #14712 from biggdawg320:jobscout/14693-cranelift-miscompile-on-aarch64-w-o-lse to bytecodealliance:main:

On aarch64 targets without LSE, the atomic_cas.i32 compare-and-swap loop compared the expected value against the loaded value using a full 64-bit cmp, unlike the I8/I16 cases which already masked to their own width via UXTB/UXTH. Since ireduce is a free no-op that doesn't clear unused high bits, an i32 expected value derived from an i64 with garbage upper bits could cause the comparison to spuriously fail even though the low 32 bits matched, silently skipping the swap. The fix special-cases I32 to clear the sf bit so the comparison only looks at the low 32 bits (cmp w27, w26), matching the i8/i16 treatment. Updated the pre-existing isa/aarch64/atomic-cas.clif fixture and the cranelift-codegen emit_tests.rs golden binary encoding for AtomicCASLoop { ty: I32 } (both previously asserted the old, buggy 64-bit comparison), and added runtests/issue14693.clif as a behavioral regression test.

Note: cranelift/filetests/filetests/isa/aarch64/issue14693.clif, flagged by review as a near-duplicate of atomic-cas.clif, is left in place unchanged — it is already correct and harmless (passes post-fix), but my available tooling has no file-delete/rename operation, only content edits, so I could not remove it. It is safe to git rm during merge; runtests/issue14693.clif plus the corrected atomic-cas.clif already provide equivalent coverage without it.

Fixes #14693

Testing


_This change was drafted with AI assistance (Claude) and verified against the project's own test suite before submission._

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

biggdawg320 requested wasmtime-compiler-reviewers for a review on PR #14712.

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

biggdawg320 requested cfallin for a review on PR #14712.

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

github-actions[bot] added the label cranelift on PR #14712.

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

github-actions[bot] added the label cranelift:area:aarch64 on PR #14712.

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

:thumbs_up: cfallin submitted PR review.

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

cfallin added PR #14712 aarch64: fix atomic_cas.i32 miscompile without LSE to the merge queue.

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

cfallin removed PR #14712 aarch64: fix atomic_cas.i32 miscompile without LSE from the merge queue.

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

:check: cfallin merged PR #14712.


Last updated: Oct 31 2026 at 23:03 UTC