diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index f687675c722..9c108056445 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -356,7 +356,8 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb, } // a variable can only be killed by subsequent instructions - for (++mi; mi != e; ++mi) { + do { + ++mi; baseIndex += InstrSlots::NUM; for (KillIter ki = lv_->killed_begin(mi), ke = lv_->killed_end(mi); ki != ke; ++ki) { @@ -366,13 +367,10 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb, goto exit; } } - } + } while (mi != e); - // LiveVariables does not compute information for dead basic blocks. - DEBUG(std::cerr << "Didn't find the end of the interval. Must be in a " - "dead block."); - end = getDefIndex(start)+1; exit: + assert(start < end && "did not find end of interval?"); interval.addRange(start, end); DEBUG(std::cerr << '\n'); }