The following two tests are failing when jit is optimizing: ``` using System; using System.Runtime.CompilerServices; public struct TwoBools { public bool b1; public bool b2; public TwoBools(bool b1, bool b2) { this.b1 = b1; this.b2 = b2; } } class Test { public static int Main() { int result = 100; if (Test1().b2) { Console.WriteLine("Test1 failed"); result = -1; } else { Console.WriteLine("Test1 passed"); } if (Test2().b2) { Console.WriteLine("Test2 failed"); result = -1; } else { Console.WriteLine("Test2 passed"); } return result; } [MethodImpl(MethodImplOptions.NoInlining)] static TwoBools Test1() { TwoBools result = CreateTwoBools(); result.b2 = false; return result; } [MethodImpl(MethodImplOptions.NoInlining)] static TwoBools Test2() { TwoBools result = default(TwoBools); result.b2 = true; result = default(TwoBools); return result; } [MethodImpl(MethodImplOptions.NoInlining)] static TwoBools CreateTwoBools() { TwoBools result = new TwoBools(true, true); return result; } } ```
Activity
erozenfeld commentedon Jun 9, 2020
optRemoveRedundantZeroInitsis not dealing correctly with untracked fields represented byLCL_VAR'sFixes and improvements for removal of redundant zero inits
Fixes and improvements for removal of redundant zero inits (#37786)