File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1481,6 +1481,7 @@ class ScalarExprLowering {
14811481 delta = builder.create <mlir::MulIOp>(loc, delta, ext);
14821482 ++dim;
14831483 }
1484+ auto origRefTy = refTy;
14841485 if (fir::factory::CharacterExprHelper::isCharacterScalar (refTy)) {
14851486 auto chTy = fir::factory::CharacterExprHelper::getCharacterType (refTy);
14861487 if (fir::characterWithDynamicLen (chTy)) {
@@ -1492,8 +1493,10 @@ class ScalarExprLowering {
14921493 base = builder.createConvert (loc, seqRefTy, base);
14931494 }
14941495 }
1495- return builder.create <fir::CoordinateOp>(
1496+ auto coor = builder.create <fir::CoordinateOp>(
14961497 loc, refTy, base, llvm::ArrayRef<mlir::Value>{total});
1498+ // Convert to expected, original type after address arithmetic.
1499+ return builder.createConvert (loc, origRefTy, coor);
14971500 };
14981501 return array.match (
14991502 [&](const fir::ArrayBoxValue &arr) -> ExtValue {
You can’t perform that action at this time.
0 commit comments