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
// Generated by Fuzzlyn v1.1 on 2021-06-12 11:06:35// Seed: 8276490119048877745// Reduced from 962.5 KiB to 0.6 KiB in 00:05:32// Debug: Outputs 0// Release: Outputs 1structS0{publicushortF1;publicuintF2;publicbyteF3;publicintF5;publicS0(bytef3):this(){F3=f3;}}structS1{publicS0F0;publicS0F4;publicS1(S0f0):this(){F0=f0;}}structS2{publicS1F0;publicS2(S1f0):this(){F0=f0;}}publicclassProgram{publicstaticvoidMain(){S2vr0=newS2(newS1(newS0(1)));System.Console.WriteLine(vr0.F0.F0.F3);System.Console.WriteLine(vr0.F0.F4.F1);}}
We end up CSE'ing the two field seqs and print 1 twice in release.
cc @dotnet/jit-contrib
// We're not going to produce a TYP_STRUCT LCL_FLD so we don't need the field sequence.
where we can generate S2 = S1 assignments. The closer we get to 6.0 the more I am thinking about disabling it and accept several kb regressions because my former tries to fix it were unsuccessful.
// Generated by Fuzzlyn v1.2 on 2021-07-06 09:46:44// Seed: 16635934940619066544// Reduced from 447.5 KiB to 0.6 KiB in 00:02:24// Debug: Runs successfully// Release: Throws 'System.NullReferenceException'structS0{publicuintF1;publicbyteF3;publiclongF4;publicuintF5;publicS0(longf4):this(){F4=f4;}}classC0{publicS0F4;}structS1{publicC0F2;publicS0F8;publicS1(C0f2,S0f8):this(){F2=f2;F8=f8;}}structS2{publicS1F0;publicS2(S1f0):this(){F0=f0;}}publicclassProgram{publicstaticvoidMain(){S2vr0=newS2(newS1(newC0(),newS0(0)));M17(refvr0.F0.F2.F4.F1);}staticvoidM17(refuintarg2){}}
Activity
SingleAccretion commentedon Jun 12, 2021
@sandreenko I've been looking at this a bit, here's a bit simpler reproduction:
With
JitNoStructPromotion=1.And the bad VN:
sandreenko commentedon Jun 12, 2021
Thanks @jakobbotsch and @SingleAccretion for the repros, I think the issue is similar to #49954, the root cause is in this optimization:
runtime/src/coreclr/jit/lclmorph.cpp
Line 1016 in 4aa29f4
where we can generate S2 = S1 assignments. The closer we get to 6.0 the more I am thinking about disabling it and accept several kb regressions because my former tries to fix it were unsuccessful.
jakobbotsch commentedon Jul 6, 2021
Not sure if this one is related:
briansull commentedon Jul 15, 2021
Triage Area: CSE