One more case assuming that subregs have live ranges.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Jul 2010 21:13:03 +0000 (21:13 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Jul 2010 21:13:03 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107700 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SimpleRegisterCoalescing.cpp

index c450136001c405a2d2e96f9273446176ad27b186..e0b9f0c10f6a9432cccb9d0c22c5ceaca4e58e00 100644 (file)
@@ -499,8 +499,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
     if (BHasSubRegs) {
       for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) {
         LiveInterval &SRLI = li_->getInterval(*SR);
-        const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def);
-        SRLI.removeValNo(SRLR->valno);
+        if (const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def))
+          SRLI.removeValNo(SRLR->valno);
       }
     }
     IntB.removeValNo(BDeadValNos[i]);