Closed
Description
With DOTNET_JitStress=2
and DOTNET_JitStressRegs=8
we hit this assert in some of the Swift tests.
ISSUE: <ASSERT> #16 C:\dev\dotnet\runtime\src\coreclr\jit\lsra.cpp (7418) - Assertion failed 'parent->OperGet() == oper' in 'SwiftRetAbiStress:TestSwiftRetFunc0()' during 'LSRA allocate' (IL size 95; hash 0xbcced63c; Tier0)
When we hit the assert, the LIR looks like the following:
N070 ( 14, 5) [000038] --CXG-----Z t38 = ▌ CALL unman struct SwiftRetAbiStress:SwiftRetFunc0():SwiftRetAbiStress+S0 REG rax,rdx,rcx
┌──▌ t38 struct
[000129] --CXG------ t129 = ▌ COPY struct REG rbx,r15,NA
N072 ( 3, 2) [000094] ----------- t94 = LCL_VAR long V03 FramesRoot NA REG NA
┌──▌ t94 long
N074 ( 4, 3) [000096] -c--------- t96 = ▌ LEA(b+12) long REG NA
N076 ( 1, 1) [000095] -c--------- t95 = CNS_INT byte 1 REG NA
┌──▌ t96 long
├──▌ t95 byte
N078 ( 10, 8) [000097] ----------- ▌ STOREIND byte REG NA
N080 ( 3, 10) [000098] Hc--------- t98 = CNS_INT(h) long 0x10e8b4e70 ftn REG NA
┌──▌ t98 long
N082 ( 5, 12) [000099] nc--G------ t99 = ▌ IND int REG NA
┌──▌ t99 int
N084 ( 6, 13) [000100] ----G------ ▌ RETURNTRAP int REG NA
N086 ( 3, 2) [000101] ----------- t101 = LCL_VAR long V03 FramesRoot NA REG NA
┌──▌ t101 long
N088 ( 4, 3) [000102] -c--------- t102 = ▌ LEA(b+16) long REG NA
N090 ( 3, 4) [000103] ----------- t103 = LCL_FLD byref (AX) V04 PInvokeFrame [+16] NA REG NA
┌──▌ t102 long
├──▌ t103 byref
N092 ( 11, 10) [000104] ----------- ▌ STOREIND long REG NA
┌──▌ t129 struct
N094 ( 24, 12) [000037] DACXG------ ▌ STORE_LCL_VAR struct<SwiftRetAbiStress+S0, 18> V02 tmp1 NA REG NA
The refPosition has refPosition->reload == 1
, but the parent node (of [000038]
) is a GT_COPY
.
I've attached an SPMI collection that repros the assertion on commit 0ea9b8f with clrjit_unix_x64_x64.dll
-- pass -c 16
.
cc @kunalspathak -- any idea?