diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp --- a/flang/runtime/io-stmt.cpp +++ b/flang/runtime/io-stmt.cpp @@ -799,7 +799,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_) {