Skip to content

Commit 2af5db2

Browse files
tannergoodingdirecthex
authored andcommitted
Resolving an antigen failure (#105260)
* Resolving an antigen failure * Fix method accessibility so xunit doesn't complain
1 parent e0f70b7 commit 2af5db2

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

src/coreclr/jit/gentree.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30524,8 +30524,11 @@ GenTree* Compiler::gtFoldExprHWIntrinsic(GenTreeHWIntrinsic* tree)
3052430524
#endif // !TARGET_XARCH && !TARGET_ARM64
3052530525

3052630526
DEBUG_DESTROY_NODE(op, tree);
30527-
INDEBUG(vectorNode->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED);
3052830527

30528+
if (fgGlobalMorph)
30529+
{
30530+
INDEBUG(vectorNode->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED);
30531+
}
3052930532
return vectorNode;
3053030533
}
3053130534
}

src/coreclr/jit/lowerxarch.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,21 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node)
15701570
op2->SetUnusedValue();
15711571
}
15721572

1573+
// Since we have a double negation, it's possible that gtNext
1574+
// is op1 or user. If it is op1, then it's also possible the
1575+
// subsequent gtNext is user. We need to make sure to skip both
1576+
// in such a scenario since we're removing them.
1577+
1578+
if (nextNode == op1)
1579+
{
1580+
nextNode = nextNode->gtNext;
1581+
}
1582+
1583+
if (nextNode == user)
1584+
{
1585+
nextNode = nextNode->gtNext;
1586+
}
1587+
15731588
BlockRange().Remove(op3);
15741589
BlockRange().Remove(op1);
15751590
BlockRange().Remove(user);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Runtime.CompilerServices;
5+
using System.Runtime.Intrinsics;
6+
using Xunit;
7+
8+
#nullable disable
9+
10+
public class Runtime_105255_A
11+
{
12+
private static Vector512<uint> s_v512_uint_62 = Vector512<uint>.Zero;
13+
14+
private void Method0()
15+
{
16+
s_v512_uint_62 = Vector512.LessThan<uint>(s_v512_uint_62, Vector512<uint>.Zero);
17+
try
18+
{
19+
}
20+
finally
21+
{
22+
for (int i = 0; i < 1; i++) ;
23+
}
24+
}
25+
26+
[Fact]
27+
public static void TestEntryPoint() => new Runtime_105255_A().Method0();
28+
29+
/*
30+
Assert failure(PID 5828 [0x000016c4], Thread: 6044 [0x179c]): Assertion failed '((tree->gtDebugFlags & GTF_DEBUG_NODE_MORPHED) == 0) && "ERROR: Already morphed this node!"' in 'TestClass:Method0():this' during 'Morph - Global' (IL size 22846; hash 0x46e9aa75; Tier0-FullOpts)
31+
File: D:\a\_work\1\s\src\coreclr\jit\morph.cpp:12227
32+
Image: C:\h\w\A715090A\p\CoreRoot\corerun.exe
33+
34+
Assertion failed '((tree->gtDebugFlags & GTF_DEBUG_NODE_MORPHED) == 0) && "ERROR: Already morphed this node!"' during 'Morph - Global'
35+
*/
36+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<Optimize>True</Optimize>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<Compile Include="$(MSBuildProjectName).cs" />
7+
</ItemGroup>
8+
</Project>

0 commit comments

Comments
 (0)