spillPhysRegAroundRegDefsUses() may have invalidated iterators stored in fixed_ IntervalPtrs. Reset them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70378 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2009-04-29 07:16:34 +00:00
parent 3a33f4903a
commit 96f3fd9a7f
2 changed files with 224 additions and 0 deletions

View File

@@ -978,6 +978,15 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
li_->getApproximateInstructionCount(*cur) == 0) {
// Spill a physical register around defs and uses.
if (li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_)) {
// spillPhysRegAroundRegDefsUses may have invalidated iterator stored
// in fixed_. Reset them.
for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
IntervalPtr &IP = fixed_[i];
LiveInterval *I = IP.first;
if (I->reg == minReg || tri_->isSubRegister(minReg, I->reg))
IP.second = I->advanceTo(I->begin(), StartPosition);
}
DowngradedRegs.clear();
assignRegOrStackSlotAtInterval(cur);
} else {