Skip to content

Commit 960a7b9

Browse files
authored
Merge pull request #1114 from schweitzpgi/ch-result
Fix pointer assignment in explicit iteration spaces to include the
2 parents 1473f87 + 9455a1c commit 960a7b9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

flang/lib/Lower/Bridge.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
19871987
fir::getBase(genExprValue(toEvExpr(lbExpr), stmtCtx)));
19881988
Fortran::lower::associateMutableBox(*this, loc, lhs, assign.rhs,
19891989
lbounds, stmtCtx);
1990+
if (explicitIterationSpace()) {
1991+
auto inners = explicitIterSpace.getInnerArgs();
1992+
if (!inners.empty()) {
1993+
// TODO: should force a copy-in/copy-out here.
1994+
// e.g., obj%ptr(i+1) => obj%ptr(i)
1995+
builder->create<fir::ResultOp>(loc, inners);
1996+
}
1997+
}
19901998
},
19911999

19922000
// [4] Pointer assignment with bounds-remapping. R1036: a
@@ -2023,6 +2031,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
20232031
: genExprAddr(assign.rhs, stmtCtx);
20242032
fir::factory::associateMutableBoxWithRemap(*builder, loc, lhs,
20252033
rhs, lbounds, ubounds);
2034+
if (explicitIterationSpace()) {
2035+
auto inners = explicitIterSpace.getInnerArgs();
2036+
if (!inners.empty()) {
2037+
// TODO: should force a copy-in/copy-out here.
2038+
// e.g., obj%ptr(i+1) => obj%ptr(i)
2039+
builder->create<fir::ResultOp>(loc, inners);
2040+
}
2041+
}
20262042
},
20272043
},
20282044
assign.u);

0 commit comments

Comments
 (0)