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 {
1481
1481
delta = builder.create <mlir::MulIOp>(loc, delta, ext);
1482
1482
++dim;
1483
1483
}
1484
+ auto origRefTy = refTy;
1484
1485
if (fir::factory::CharacterExprHelper::isCharacterScalar (refTy)) {
1485
1486
auto chTy = fir::factory::CharacterExprHelper::getCharacterType (refTy);
1486
1487
if (fir::characterWithDynamicLen (chTy)) {
@@ -1492,8 +1493,10 @@ class ScalarExprLowering {
1492
1493
base = builder.createConvert (loc, seqRefTy, base);
1493
1494
}
1494
1495
}
1495
- return builder.create <fir::CoordinateOp>(
1496
+ auto coor = builder.create <fir::CoordinateOp>(
1496
1497
loc, refTy, base, llvm::ArrayRef<mlir::Value>{total});
1498
+ // Convert to expected, original type after address arithmetic.
1499
+ return builder.createConvert (loc, origRefTy, coor);
1497
1500
};
1498
1501
return array.match (
1499
1502
[&](const fir::ArrayBoxValue &arr) -> ExtValue {
You can’t perform that action at this time.
0 commit comments