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.
JIT: fix flags lossage in morph comma/ind interchange (dotnet#68082)
Morph may transform `IND(COMMA(..., z))` into `COMMA(... , IND(z))` and when doing so it was not computing appropriately conservative flags for the new `IND`. In particular it was losing `GTF_GLOB_REF`. This allowed subsequent opts to reorder operands in an unsafe manner. Fixes dotnet#68049.
- Loading branch information
1 parent
2c3e1c7
commit 471a297
Showing
3 changed files
with
93 additions
and
2 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
70 changes: 70 additions & 0 deletions
70
src/tests/JIT/Regression/JitBlue/Runtime_68049/Runtime_68049_0.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,70 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
// Generated by Fuzzlyn v1.5 on 2022-04-13 11:38:00 | ||
// Run on X64 Linux | ||
// Seed: 1784259920377383051 | ||
// Reduced from 110.5 KiB to 0.9 KiB in 00:00:57 | ||
// Debug: Outputs 1 | ||
// Release: Outputs 0 | ||
|
||
public struct S0 | ||
{ | ||
public uint F0; | ||
public long F1; | ||
public S0(uint f0): this() | ||
{ | ||
F0 = f0; | ||
} | ||
|
||
public ulong M5() | ||
{ | ||
var vr1 = new ushort[]{0}; | ||
M6(vr1); | ||
return 1; | ||
} | ||
|
||
public void M6(ushort[] arg0) | ||
{ | ||
this = new S0(0); | ||
} | ||
} | ||
|
||
public class Runtime_68049_0 | ||
{ | ||
public static long s_result; | ||
public static IRuntime s_rt; | ||
public static int Main() | ||
{ | ||
s_rt = new Runtime(); | ||
var vr4 = new S0[]{new S0(1)}; | ||
var vr5 = new short[]{0}; | ||
bool vr6 = M1(vr4, vr5) <= 1; | ||
return (int)s_result; | ||
} | ||
|
||
public static short M1(S0[] arg0, short[] arg1) | ||
{ | ||
long var3 = arg0[0].F1; | ||
var3 = (arg0[0].F0 & (byte)arg0[0].M5()); | ||
s_rt.WriteLine(var3); | ||
return arg1[0]; | ||
} | ||
} | ||
|
||
public interface IRuntime | ||
{ | ||
void WriteLine<T>(T value); | ||
} | ||
|
||
public class Runtime : IRuntime | ||
{ | ||
public void WriteLine<T>(T value) | ||
{ | ||
System.Console.WriteLine(value); | ||
if (typeof(T) == typeof(long)) | ||
{ | ||
Runtime_68049_0.s_result = ((long)(object)value) + 99; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_68049/Runtime_68049_0.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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |