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) static struct field read hoisted above its class initializer (CopyFieldByField drops GTF_IND_INITCLASS) #134897
A promoted struct local copied from a beforefieldinit static struct field inside a loop gets its field loads hoisted into the preheader, ahead of the class-init helper, so the loads see zero-initialized static storage.
Not a regression: wrong result on .NET 8, 9, 10, 11 RC2 and main.
Notes
MorphCopyBlockHelper::CopyFieldByField (morphblock.cpp) creates per-field INDs via getCopyIndirFlags, which drops the source's GTF_IND_INITCLASS (and volatile/unaligned flags). Loop hoisting then doesn't treat them as cctor-dependent. DOTNET_JitNoHoist=1 gives 92. Not reproducible with an explicit static constructor.
Activity
dotnet-policy-service commentedon Sep 29, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: Preserve indirection flags in field-by-field struct copies (#137090