projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bc2ad2
)
[flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count
author
Peter Klausler
<pklausler@nvidia.com>
Tue, 7 Jun 2022 17:11:17 +0000
(10:11 -0700)
committer
Peter Klausler
<pklausler@nvidia.com>
Mon, 13 Jun 2022 18:34:25 +0000
(11:34 -0700)
The calculation of the source index was incorrect when a CSHIFT shift
count value is negative, for the implementation of CSHIFT for arrays
with rank >= 2. (The vector CSHIFT is fine.)
Differential Revision: https://reviews.llvm.org/D127424
flang/runtime/transformational.cpp
patch
|
blob
|
history
diff --git
a/flang/runtime/transformational.cpp
b/flang/runtime/transformational.cpp
index
ac12627
..
9a01681
100644
(file)
--- a/
flang/runtime/transformational.cpp
+++ b/
flang/runtime/transformational.cpp
@@
-167,7
+167,7
@@
void RTNAME(Cshift)(Descriptor &result, const Descriptor &source,
}
SubscriptValue &sourceDim{sourceAt[dim - 1]};
sourceDim = dimLB + shiftCount % dimExtent;
- if (s
hiftCount < 0
) {
+ if (s
ourceDim < dimLB
) {
sourceDim += dimExtent;
}
for (resDim = 1; resDim <= dimExtent; ++resDim) {