[flang-commits] [PATCH] D127424: [flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jun 13 11:34:47 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbd577afe8fcc: [flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127424/new/

https://reviews.llvm.org/D127424

Files:
  flang/runtime/transformational.cpp


Index: flang/runtime/transformational.cpp
===================================================================
--- flang/runtime/transformational.cpp
+++ flang/runtime/transformational.cpp
@@ -167,7 +167,7 @@
     }
     SubscriptValue &sourceDim{sourceAt[dim - 1]};
     sourceDim = dimLB + shiftCount % dimExtent;
-    if (shiftCount < 0) {
+    if (sourceDim < dimLB) {
       sourceDim += dimExtent;
     }
     for (resDim = 1; resDim <= dimExtent; ++resDim) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127424.436492.patch
Type: text/x-patch
Size: 465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220613/af592ac4/attachment.bin>


More information about the flang-commits mailing list