diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 2713771ceb23..6925de3abf15 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -886,6 +886,7 @@ unsigned RALinScan::getFreePhysReg(LiveInterval *cur) { // Scan for the first available register. TargetRegisterClass::iterator I = RC->allocation_order_begin(*mf_); TargetRegisterClass::iterator E = RC->allocation_order_end(*mf_); + assert(I != E && "No allocatable register in this register class!"); for (; I != E; ++I) if (prt_->isRegAvail(*I)) { FreeReg = *I;