Author: rksimon Date: Wed May 22 06:02:19 2019 New Revision: 361379 URL: http://llvm.org/viewvc/llvm-project?rev=361379&view=rev Log: [CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not zero. NFCI.
Fixes scan-build division by zero warning. Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=361379&r1=361378&r2=361379&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original) +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Wed May 22 06:02:19 2019 @@ -9774,8 +9774,9 @@ emitX86DeclareSimdFunction(const Functio llvm::raw_svector_ostream Out(Buffer); Out << "_ZGV" << Data.ISA << Mask; if (!VLENVal) { - Out << llvm::APSInt::getUnsigned(Data.VecRegSize / - evaluateCDTSize(FD, ParamAttrs)); + unsigned NumElts = evaluateCDTSize(FD, ParamAttrs); + assert(NumElts && "Non-zero simdlen/cdtsize expected"); + Out << llvm::APSInt::getUnsigned(Data.VecRegSize / NumElts); } else { Out << VLENVal; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits