-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: Fix invalid zero-init suppression for untracked variables (#91580)
optRemoveRedundantZeroInits has logic to remove unnecessary zero inits if we can determine that the local will be zeroed in the prolog. In addition, it also has logic to suppress the prolog zero init if there is a dominating initialization already. The latter logic was trying to reason about liveness for untracked locals, which does not make sense. Fix #91576
- Loading branch information
1 parent
9f138e0
commit 671d42c
Showing
3 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/tests/JIT/Regression/JitBlue/Runtime_91576/Runtime_91576.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license.aa | ||
|
||
// Generated by Fuzzlyn v1.6 on 2023-09-03 15:59:01 | ||
// Run on X64 Windows | ||
// Seed: 11520325105937570553 | ||
// Reduced from 294.5 KiB to 0.7 KiB in 00:04:32 | ||
// Debug: Outputs False | ||
// Release: Outputs True | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
public class Runtime_91576 | ||
{ | ||
[Fact] | ||
public static int TestEntryPoint() | ||
{ | ||
Assert.Throws<NullReferenceException>(() => | ||
{ | ||
Run(new int[1]); | ||
Run(null); | ||
}); | ||
|
||
return s_result; | ||
} | ||
|
||
static int s_result; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Run(int[] l) | ||
{ | ||
bool b = false; | ||
try | ||
{ | ||
int result = l[0]; | ||
b = true; | ||
} | ||
finally | ||
{ | ||
Check(ref b); | ||
} | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Check(ref bool b) | ||
{ | ||
s_result = b ? 101 : 100; | ||
} | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_91576/Runtime_91576.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |