https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65684
--- Comment #8 from Alexander Vogt <a.vogt at fulguritus dot com> --- I think this happens in io/transfer.c: 413 void * 414 read_block_form (st_parameter_dt *dtp, int * nbytes) 415 { ... 419 if (!is_stream_io (dtp)) 420 { 421 if (dtp->u.p.current_unit->bytes_left < (gfc_offset) *nbytes) 422 { ... 430 if (unlikely (dtp->u.p.current_unit->pad_status == PAD_NO) 431 && !is_internal_unit (dtp)) 432 { 433 /* Not enough data left. */ 434 generate_error (&dtp->common, LIBERROR_EOR, NULL); 435 return NULL; 436 } 437 } ... I'm a little confused, though... Aren't we writing to an internal unit here? This case seems not to be covered.