}
}
else
-#else
+#endif
{
recentAssignedRef = assignedInterval->recentRefPosition;
if (!canSpillReg(physRegRecord, refLocation, &recentAssignedRefWeight))
continue;
}
}
-#endif
- if (recentAssignedRefWeight > farthestRefPosWeight)
+ if (recentAssignedRefWeight > farthestRefPosWeight)
{
continue;
}
{
Interval* assignedInterval = regRec->assignedInterval;
assert(assignedInterval != nullptr);
-
regNumber thisRegNum = regRec->regNum;
+ // Is assignedInterval actually still assigned to this register?
+ bool intervalIsAssigned = (assignedInterval->physReg == thisRegNum);
+
#ifdef _TARGET_ARM_
RegRecord* anotherRegRec = nullptr;
// Both two RegRecords should have been assigned to the same interval.
assert(assignedInterval == anotherRegRec->assignedInterval);
+ if (!intervalIsAssigned && (assignedInterval->physReg == anotherRegRec->regNum))
+ {
+ intervalIsAssigned = true;
+ }
}
#endif // _TARGET_ARM_
nextRefPosition = spillRefPosition->nextRefPosition;
}
- if (assignedInterval->physReg != REG_NA && assignedInterval->physReg != thisRegNum)
+ if (!intervalIsAssigned && assignedInterval->physReg != REG_NA)
{
// This must have been a temporary copy reg, but we can't assert that because there
// may have been intervening RefPositions that were not copyRegs.