I've come across a bug in RALinScan::assignRegOrStackSlotAtInterval that occurs when:<div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>- an interval conflicts with all physical registers in it's class</div>
<div>- and one of the phys regs has a lower spill weight then the interval being assigned</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>- and there are no active or inactive intervals (or no entries of an overlapping reg class)</div>
</div><div><br></div><div>findIntervalsToSplit then runs but won't be able to find the best candidate as it fails to find a anything suitable in the 'active_' or 'inactive_' lists. The code asserts that there's nothing to spill.</div>
<div><br></div><div>It's a fairly obscure set of circumstances but can happen if there is a register class with no callee saved registers and a call instruction (that implicitly defines all registers in that class).  It (probably?) also requires that the interval being assigned is itself the result of spilling as both the spill weight needs to be quite high.</div>
<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>I've attached a fix that spills the current interval if findIntervalsToSplit returns nothing.</div></div><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<div>e.g.</div><div>BB#1;  %reg16418 is a fresh interval resuting from a spill, no other interval is active<br class="Apple-interchange-newline">... = ADD %reg16418  ; DTR:%reg16418  ; should remat here</div></div><div>CALL ... ; imp-def of all regs in DTR</div>
<div><div><div>... = SUB %reg16418  ; DTR:%reg16418  ; should remat here</div></div></div><div><br></div><div>Krister</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div></div>
</div>