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) volatile load dropped when byteField >= 0 is folded to true (spin loop hangs) #134477
When volatileByte >= 0 is folded to true, the volatile load is removed along with its acquire barrier. That lets a non-volatile load get hoisted out of the loop, and the loop never ends.
Yes, a regression in .NET 9. .NET 8 passes. .NET 9, 10, 11 RC2 and main hang.
Notes
fgOptimizeRelationalComparisonWithFullRangeConst only checks GTF_SIDE_EFFECT, so the non-faulting volatile IND (which only has GTF_ORDER_SIDEEFF) gets discarded. ECMA-335 I.12.6.7 forbids removing volatile operations. It also reproduces without AggressiveOptimization (via OSR/Tier1).
This is related to #134194 (volatile loads dropped), but the drop happens at a different place.
Activity
dotnet-policy-service commentedon Sep 22, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: Keep volatile loads when folding full-range relational compariso…