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
Volatile reads of a promoted struct's field lose volatile semantics when the struct is address-exposed #136936
A volatile field read through a promoted struct local is rewritten by local morph into a plain read of the promoted field local, and the volatile flag is dropped. Later phases then treat it as an ordinary value: repeated reads are folded, and no acquire barrier is emitted.
The non-promoted parameter version keeps the expected four acquire loads. Volatile.Read is also fine because its intrinsic expansion takes the correct path instead of:
Activity
dotnet-policy-service commentedon Nov 3, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
Keep volatile indirections of promoted struct fields (dotnet#136940)