[PATCH] D53827: [OpenMP][NFC] Fix condition.

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 29 12:32:43 PDT 2018


gtbercea created this revision.
Herald added subscribers: cfe-commits, guansong.
gtbercea added reviewers: ABataev, caomhin.

Iteration variable must be strictly less than the number of iterations.


Repository:
  rC Clang

https://reviews.llvm.org/D53827

Files:
  lib/Sema/SemaOpenMP.cpp


Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -5299,7 +5299,8 @@
   ExprResult CombDistCond;
   if (isOpenMPLoopBoundSharingDirective(DKind)) {
     CombDistCond =
-        SemaRef.BuildBinOp(CurScope, CondLoc, BO_LE, IV.get(), NumIterations.get());
+        SemaRef.BuildBinOp(
+            CurScope, CondLoc, BO_LT, IV.get(), NumIterations.get());
   }
 
   ExprResult CombCond;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53827.171555.patch
Type: text/x-patch
Size: 493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181029/a1b8cf76/attachment.bin>


More information about the cfe-commits mailing list