diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index db0339be745..c54bb0391d0 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1492,7 +1492,8 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalObject *GV) const { if (NumBits == 0) return; // 1-byte aligned: no need to emit alignment. - assert(NumBits < std::numeric_limits::digits && + assert(NumBits < + static_cast(std::numeric_limits::digits) && "undefined behavior"); if (getCurrentSection()->getKind().isText()) OutStreamer.EmitCodeAlignment(1u << NumBits); diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp index 18c82c85e55..9d3ba5e0a55 100644 --- a/lib/CodeGen/ExecutionDepsFix.cpp +++ b/lib/CodeGen/ExecutionDepsFix.cpp @@ -74,7 +74,8 @@ struct DomainValue { // Is domain available? bool hasDomain(unsigned domain) const { - assert(domain < std::numeric_limits::digits && + assert(domain < + static_cast(std::numeric_limits::digits) && "undefined behavior"); return AvailableDomains & (1u << domain); } diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index e908c42e975..a319944c0e2 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -8577,7 +8577,8 @@ static SDValue PerformBFICombine(SDNode *N, unsigned InvMask = cast(N->getOperand(2))->getZExtValue(); unsigned LSB = countTrailingZeros(~InvMask); unsigned Width = (32 - countLeadingZeros(~InvMask)) - LSB; - assert(Width < std::numeric_limits::digits && + assert(Width < + static_cast(std::numeric_limits::digits) && "undefined behavior"); unsigned Mask = (1u << Width) - 1; unsigned Mask2 = N11C->getZExtValue();