[flang-commits] [flang] 77ab08e - [flang][runtime] fix buildbot failure after #69199
Jean Perier via flang-commits
flang-commits at lists.llvm.org
Tue Oct 17 00:08:15 PDT 2023
Author: Jean Perier
Date: 2023-10-16T23:59:15-07:00
New Revision: 77ab08e1ffa875f0e739357b81cdb197ff19ecb0
URL: https://github.com/llvm/llvm-project/commit/77ab08e1ffa875f0e739357b81cdb197ff19ecb0
DIFF: https://github.com/llvm/llvm-project/commit/77ab08e1ffa875f0e739357b81cdb197ff19ecb0.diff
LOG: [flang][runtime] fix buildbot failure after #69199
Fix https://lab.llvm.org/buildbot/#/builders/268/builds/360
Added:
Modified:
flang/include/flang/Runtime/descriptor.h
flang/runtime/ISO_Fortran_binding.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Runtime/descriptor.h b/flang/include/flang/Runtime/descriptor.h
index 85240353e8ae9e0..a5747f98ff2bd4d 100644
--- a/flang/include/flang/Runtime/descriptor.h
+++ b/flang/include/flang/Runtime/descriptor.h
@@ -393,7 +393,8 @@ class Descriptor {
bool stridesAreContiguous{true};
for (int j{0}; j < leadingDimensions; ++j) {
const Dimension &dim{GetDimension(j)};
- stridesAreContiguous &= (bytes == dim.ByteStride()) | (dim.Extent() == 1);
+ stridesAreContiguous &=
+ (bytes == dim.ByteStride()) || (dim.Extent() == 1);
bytes *= dim.Extent();
}
// One and zero element arrays are contiguous even if the descriptor
diff --git a/flang/runtime/ISO_Fortran_binding.cpp b/flang/runtime/ISO_Fortran_binding.cpp
index c2e82758ae08aef..ce146844533a064 100644
--- a/flang/runtime/ISO_Fortran_binding.cpp
+++ b/flang/runtime/ISO_Fortran_binding.cpp
@@ -130,7 +130,7 @@ RT_API_ATTRS int CFI_is_contiguous(const CFI_cdesc_t *descriptor) {
CFI_index_t bytes = descriptor->elem_len;
for (int j{0}; j < descriptor->rank; ++j) {
stridesAreContiguous &=
- (bytes == descriptor->dim[j].sm) | (descriptor->dim[j].extent == 1);
+ (bytes == descriptor->dim[j].sm) || (descriptor->dim[j].extent == 1);
bytes *= descriptor->dim[j].extent;
}
if (stridesAreContiguous || bytes == 0) {
More information about the flang-commits
mailing list