Skip to content

Commit

Permalink
JIT: Fix repeatable failure for max CALLSITE_DEPTH (#63966)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Jan 19, 2022
1 parent a354bb1 commit 313baef
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/coreclr/jit/fginline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ unsigned Compiler::fgCheckInlineDepthAndRecursion(InlineInfo* inlineInfo)
// This inline candidate has the same IL code buffer as an already
// inlined method does.
inlineResult->NoteFatal(InlineObservation::CALLSITE_IS_RECURSIVE);
break;

// No need to note CALLSITE_DEPTH we're already rejecting this candidate
return depth;
}

if (depth > InlineStrategy::IMPLEMENTATION_MAX_INLINE_DEPTH)
Expand Down
13 changes: 13 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Found by Antigen

public class Runtime_63942
{
public static int Main()
{
var _ = 3.14.ToString();
return 100;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Optimize>True</Optimize>
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
set COMPlus_EnableHWIntrinsic=0
set COMPlus_JITInlineDepth=0
set COMPlus_TieredCompilation=0
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
export COMPlus_EnableHWIntrinsic=0
export COMPlus_JITInlineDepth=0
export COMPlus_TieredCompilation=0
]]></BashCLRTestPreCommands>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>

0 comments on commit 313baef

Please sign in to comment.