Index: flang/runtime/io-stmt.cpp =================================================================== --- flang/runtime/io-stmt.cpp +++ flang/runtime/io-stmt.cpp @@ -796,7 +796,9 @@ if (remaining_ > 0) { repeatPosition_.emplace(io); } - return edit; + if (!imaginaryPart_) { + return edit; + } } // Skip separators, handle a "r*c" repeat count; see 13.10.2 in Fortran 2018 if (imaginaryPart_) {