forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ADDR(IND(tree))=>tree transformation in morph.
ADDR(IND(tree)) => tree transformation was losing zero field sequence annotation that was causing incorrect value numbering and asserts in the CSE optimization. Fixes dotnet/coreclr#27107. Commit migrated from dotnet/coreclr@f929feb
- Loading branch information
1 parent
e6c64c6
commit cf678ad
Showing
3 changed files
with
73 additions
and
0 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
53 changes: 53 additions & 0 deletions
53
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_99999/GitHub_99999.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,53 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
struct S | ||
{ | ||
public Program p; | ||
public int i; | ||
} | ||
|
||
struct T | ||
{ | ||
public S s; | ||
} | ||
|
||
class Program | ||
{ | ||
public T t; | ||
public T t1; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
int Test() | ||
{ | ||
// The bug was that a field sequence annotation was lost | ||
// when morph was transforming ADDR(IND(tree)) into tree | ||
// when processing this.t.s.p. | ||
if (this.t.s.p == this.t1.s.p) | ||
{ | ||
return 0; | ||
} | ||
this.t1.s = this.t.s; | ||
int result = Helper(this.t.s); | ||
return result; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static int Helper(S s) | ||
{ | ||
return s.i; | ||
} | ||
|
||
static int Main() | ||
{ | ||
Program p = new Program(); | ||
p.t.s.i = 100; | ||
p.t.s.p = p; | ||
|
||
return p.Test(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_99999/GitHub_99999.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,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |