You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: (bug) [ARM64] load after a post-indexed ldr with the same immediate is wrongly replaced by mov (wrong result) #135522
On arm64, a load that follows a post-indexed ldr x1, [x0], #9 and uses the same immediate (ldr x0, [x0, #9]) is wrongly replaced by mov x0, x1, which produces a wrong result.
The second load is replaced by a mov of the first load's result:
ldr x1,[x0], #0x09mov x0, x1 ; should be `ldr x0, [x0, #0x09]`eor x0, x1, x0
Regression?
Yes. .NET 10.0.12 doesn't reproduce (it emits ldr x2, [x0], #0x09 ... ldr x0, [x0, #0x09]); main reproduces with both Checked and Release JIT.
Notes
IsOptimizableLdrToMov (emitarm64.cpp) compares fmt/imm/base but doesn't check whether the previous ldr is post-indexed (idInsOpt() == INS_OPTS_POST_INDEX), so the writeback immediate (9) is treated as a load displacement.
IsOptimizableLdrStrWithPair has the same missing guard.
Activity
dotnet-policy-service commentedon Oct 9, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: exclude arm64 writeback accesses from load/store peepholes (dotn…