[flang-commits] [flang] [flang][MIF] Fix ucobounds given in mif.alloc_coarray #207858 (PR #207935)

via flang-commits flang-commits at lists.llvm.org
Tue Jul 7 01:59:00 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Jean-Didier PAILLEUX (JDPailleux)

<details>
<summary>Changes</summary>

This PR provide a manior fix to issue #<!-- -->207858  when the `ucobound` array is passed to mif.alloc_coarray. This array was built from the values in `lcobound`.


---
Full diff: https://github.com/llvm/llvm-project/pull/207935.diff


1 Files Affected:

- (modified) flang/lib/Lower/MultiImageFortran.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Lower/MultiImageFortran.cpp b/flang/lib/Lower/MultiImageFortran.cpp
index dc84a00c29d10..e4374c276c069 100644
--- a/flang/lib/Lower/MultiImageFortran.cpp
+++ b/flang/lib/Lower/MultiImageFortran.cpp
@@ -330,7 +330,7 @@ Fortran::lower::genUpperCoBounds(Fortran::lower::AbstractConverter &converter,
     ucobounds = builder.createTemporary(loc, arrayType);
     mlir::Value ucovalue;
     for (size_t i = 0; i < corank - 1; i++) {
-      if (auto ub = object->coshape()[i].lbound().GetExplicit()) {
+      if (auto ub = object->coshape()[i].ubound().GetExplicit()) {
         auto ubExpr = ignoreEvConvert(*ub);
         ucovalue = fir::getBase(converter.genExprValue(loc, ubExpr, stmtCtx));
       } else {

``````````

</details>


https://github.com/llvm/llvm-project/pull/207935


More information about the flang-commits mailing list