-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion failed 'fgReachable(begBlk, endBlk)' during 'Update flow graph opt pass' #64764
Comments
@dotnet/jit-contrib |
Tagging subscribers to this area: @JulieLeeMSFT Issue Details// Found by Antigen
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public class TestClass
{
public struct S1
{
}
public struct S2
{
public ulong ulong_1;
}
static bool s_bool_2 = false;
static byte s_byte_3 = 5;
static int s_int_8 = 2;
static S1 s_s1_16 = new S1();
static S2 s_s2_17 = new S2();
int int_24 = -2;
sbyte sbyte_26 = 10;
S2 s2_33 = new S2();
static int s_loopInvariant = 4;
public bool LeafMethod0()
{
unchecked
{
return 15>=4&& s_bool_2;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
public int LeafMethod6()
{
unchecked
{
return s_int_8 >>= int_24;
}
}
public uint Method1(out S2 p_s2_34, out S1 p_s1_35, S1 p_s1_36, out byte p_byte_37, S1 p_s1_38, ref ulong p_ulong_39)
{
unchecked
{
bool bool_40 = false;
char char_42 = 'J';
sbyte sbyte_48 = 1;
p_s2_34 = s2_33;
p_s1_35 = s_s1_16;
p_byte_37 = s_byte_3 = s_byte_3 <<= 15^4;
int __loopvar43 = 15-4, __loopSecondaryVar43_0 = s_loopInvariant;
for (; s_int_8 < 15%4; s_int_8++)
{
if ((sbyte_26 += 15-4)< sbyte_48)
{
switch (char_42 = char_42 = char_42)
{
case 'K':
{
break;
}
case 'I':
{
if (LeafMethod0())
{
int __loopvar9 = s_loopInvariant;
while (bool_40)
{
if (bool_40 = s_bool_2 = (int_24 %= 15+4)> (int_24 &= LeafMethod6()))
{
}
else
{
}
try
{
int __loopvar8 = s_loopInvariant, __loopSecondaryVar8_0 = 15+4;
}
catch (System.TimeZoneNotFoundException)
{
}
}
}
else
{
}
break;
}
case 'A':
{
break;
}
case 'C':
{
break;
}
case 'M':
{
break;
}
case '2':
{
break;
}
default:
{
break;
}
}
}
else
{
}
}
return 15|4;
}
}
public void Method0()
{
unchecked
{
uint uint_99 = 5;
S1 s1_101 = new S1();
uint_99 = Method1(out s_s2_17, out s1_101, s_s1_16, out s_byte_3, s_s1_16, ref s2_33.ulong_1);
return;
}
}
public static void Main(string[] args)
{
new TestClass().Method0();
}
}
/*
Got output diff:
--------- Baseline ---------
Environment:
--------- Test ---------
Environment:
set COMPlus_TieredCompilation=0
set COMPlus_JitDoCopyProp=1
set COMPlus_EnableSSE41=1
set COMPlus_JitStress=2
set COMPlus_GCStress=0xC
set COMPlus_AltJitName=clrjit_win_x86_x64.dll
set COMPlus_AltJit=Method1
Assert failure(PID 198288 [0x00030690], Thread: 232112 [0x38ab0]): Assertion failed 'fgReachable(begBlk, endBlk)' in 'TestClass:Method1(byref,byref,S1,byref,S1,byref):int:this' during 'Update flow graph opt pass' (IL size 270)
File: D:\git\dotnet-runtime\src\coreclr\jit\optimizer.cpp Line: 167
Image: d:\git\dotnet-runtime\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe
*/
|
This repros with an x86 VM/JIT with just:
@kunalspathak |
We have on and off configs for most of the switches and then we pick random value among them. So some switches might be redundant. |
Due to very odd, stress-induced flow graph, on x86, the fall-through predecessor block to an empty (but not unreachable) block was a "catch" handler that was not reachable from the block's target (since "catch" blocks don't have predecessors). However, the code in fgRemoveBlock that was calling optScaleLoopBlocks didn't make any sense, and removing it causes no diffs. So get rid of it. Fixes dotnet#64764
Due to very odd, stress-induced flow graph, on x86, the fall-through predecessor block to an empty (but not unreachable) block was a "catch" handler that was not reachable from the block's target (since "catch" blocks don't have predecessors). However, the code in fgRemoveBlock that was calling optScaleLoopBlocks didn't make any sense, and removing it causes no diffs. So get rid of it. Fixes #64764
The text was updated successfully, but these errors were encountered: