From a90fc6617fb5df0d07956d08cbc300dca5924680 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 25 Jun 2019 16:00:43 +0000 Subject: [OPENMP]Fix PR41966: type mismatch in runtime functions. Target-based runtime functions use int64_t type for sizes, while the compiler uses size_t type. It leads to miscompilation in 32 bit mode. llvm-svn: 364327 --- clang/lib/CodeGen/CGStmtOpenMP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp') diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 6a973cdb57e..a5396a362f2 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -3119,7 +3119,8 @@ void CodeGenFunction::EmitOMPTargetTaskBasedDirective( PVD = createImplicitFirstprivateForType( getContext(), Data, BaseAndPointersType, CD, S.getBeginLoc()); QualType SizesType = getContext().getConstantArrayType( - getContext().getSizeType(), ArrSize, ArrayType::Normal, + getContext().getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1), + ArrSize, ArrayType::Normal, /*IndexTypeQuals=*/0); SVD = createImplicitFirstprivateForType(getContext(), Data, SizesType, CD, S.getBeginLoc()); -- cgit v1.2.3