surajk-m opened PR #13399 from surajk-m:fix/issue-13076 to bytecodealliance:main:
Closes #13076.
Sub-word
atomic_rmw(i8/i16) loops on riscv64 emitted a secondlr.w.aqrlbefore the merge step, which cancelled the reservation from the first LR. Thesc.w.aqrlwas then paired only with the reload, breaking atomicity.Fix: replace the second LR with
gen_moveto stash the already loaded word intospilltmp2, so the loop keeps a single LR/SC pair.Affected ops:
add,sub,and,or,xor,nand,xchg,umin,umax,smin,smaxfori8/i16.A dedicated filetest (
issue-13076.clif) pins the single LR/SC shape for each affected op.
surajk-m requested cfallin for a review on PR #13399.
surajk-m requested wasmtime-compiler-reviewers for a review on PR #13399.
github-actions[bot] added the label cranelift on PR #13399.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #13399 Fix double lr.w in sub-word atomic_rmw loops to the merge queue.
:check: cfallin merged PR #13399.
cfallin removed PR #13399 Fix double lr.w in sub-word atomic_rmw loops from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC