[RyuJIT/ARM32] Assertion failed 'currentInterval->assignedReg != nullptr && currentInterval->assignedReg->regNum == assignedRegister && currentInterval->assignedReg->assignedInterval == currentInterval'
With COMPlus_AltJit=* COMPlus_AltJitAssertOnNYI=0, following assertion is observed.
Assert failure(PID 25360 [0x00006310], Thread: 25360 [0x6310]): Assertion failed 'currentInterval->assignedReg != nullptr && currentInterval->assignedReg->regNum == assignedRegister && currentInterval->assignedReg->assignedInterval == currentInterval' in 'testout1:Func_0_4_1_5():double' (IL size 208)
File: /opt/code/github/hqueue/coreclr/src/jit/lsra.cpp Line: 7553
Failed test:
JIT/Methodical/fp/exgen/10w5d_cs_ro/10w5d_cs_ro.sh
@BruceForstall I'll look this issue. Please assign this to me.
If the type of the 18 Register that would be defined on current interval is TYP_DOUBLE, unassigning the interval of 19 Register is also needed.
|f16 |f17 |f18 |f19 |f20 |f21 |f22 |
+----+----+----+----+----+----+----+
183.#312 V3 Use * Keep f18 |V1 a|V1 a|V3 i| |V4 a|V4 a|V18a|
183.#313 C59 Use * Keep f0 |V1 a|V1 a|V3 i| |V4 a|V4 a|V18a|
184.#314 I60 Def Alloc f19 |V1 a|V1 a|V3 i|I60a|V4 a|V4 a|V18a|
185.#315 I60 Use * Keep f19 |V1 a|V1 a|V3 i|I60a|V4 a|V4 a|V18a|
186.#316 V20 Def Alloc f19 |V1 a|V1 a|V3 i|V20a|V4 a|V4 a|V18a|
189.#317 V20 Use * Keep f19 |V1 a|V1 a|V3 i|V20i|V4 a|V4 a|V18a|
190.#318 V9 Def Alloc f0 |V1 a|V1 a|V3 i|V20i|V4 a|V4 a|V18a|
193.#319 V9 Use * Keep f0 |V1 a|V1 a|V3 i|V20i|V4 a|V4 a|V18a|
194.#320 I61 Def Alloc f18 |V1 a|V1 a|I61a|I61a|V4 a|V4 a|V18a| <<< Double
195.#321 I61 Use * Keep f18 |V1 a|V1 a|I61a|I61a|V4 a|V4 a|V18a|
currentInterval = I61, F18/F19, TYP_DOUBLE
availablePhysRegInterval = V3, F18, TYP_FLOAT
https://github.com/dotnet/coreclr/blob/master/src/jit/lsra.cpp#L5668
In LinearScan::tryAllocateFreeReg() If the currentInterval has TYP_DOUBLE register, there are some cases to consider.
- The register already allocated before is an float register. : Another half interval of register should be unassigned too.
- The register to unassign was not set. (another half interval was set only.) : Another half interval of register should be unassigned only.
- When the score is calculated, if another half register is set only, the score would be not set UNASSIGNED.
There seems additional case that the register is unassigned in LinearScan::allocateBusyReg(). (Spill)
Fixed with dotnet/coreclr#13100
@sjsinju Thanks !