Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -463,6 +463,9 @@ varField = DT; } + assert(forwardingField && "forwarding field must not be NULL"); + assert(varField && "var field must not be NULL"); + // Get the offsets for the forwarding field and the variable field. unsigned forwardingFieldOffset = forwardingField->getOffsetInBits() >> 3; unsigned varFieldOffset = varField->getOffsetInBits() >> 2; Index: lib/CodeGen/ScheduleDAGInstrs.cpp =================================================================== --- lib/CodeGen/ScheduleDAGInstrs.cpp +++ lib/CodeGen/ScheduleDAGInstrs.cpp @@ -914,7 +914,8 @@ for (MachineBasicBlock::iterator MII = RegionEnd, MIE = RegionBegin; MII != MIE; --MII) { MachineInstr *MI = std::prev(MII); - if (MI && DbgMI) { + + if (DbgMI) { DbgValues.push_back(std::make_pair(DbgMI, MI)); DbgMI = nullptr; } Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6465,6 +6465,9 @@ // assign it now. if (unsigned AssignedReg = PhysReg.first) { const TargetRegisterClass *RC = PhysReg.second; + + assert(RC && "TargetRegisterClass needs to be not NULL"); + if (OpInfo.ConstraintVT == MVT::Other) ValueVT = *RC->vt_begin();