X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FRegAllocLocal.cpp;h=59831f0b707aef295b27960b9dfe9d3648fead81;hb=990f032907ae171cc3d465a694e8e6d2a6545f57;hp=18e7656bd46e57ce60c67ed5a003a5e7dff65de7;hpb=844731a7f1909f55935e3514c9e713a62d67662e;p=oota-llvm.git diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 18e7656bd46..59831f0b707 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -549,10 +549,10 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) { // If this is the first basic block in the machine function, add live-in // registers as active. - if (&MBB == &*MF->begin()) { - for (MachineRegisterInfo::livein_iterator I=MF->getRegInfo().livein_begin(), - E = MF->getRegInfo().livein_end(); I != E; ++I) { - unsigned Reg = I->first; + if (&MBB == &*MF->begin() || MBB.isLandingPad()) { + for (MachineBasicBlock::livein_iterator I = MBB.livein_begin(), + E = MBB.livein_end(); I != E; ++I) { + unsigned Reg = *I; MF->getRegInfo().setPhysRegUsed(Reg); PhysRegsUsed[Reg] = 0; // It is free and reserved now AddToPhysRegsUseOrder(Reg);