------- Comment #3 from jvdelisle at gcc dot gnu dot org 2008-12-06 21:01 ------- I did miss an fbuf_flush. I am not sure why it matters unless it is avoiding some actual disk operations for us. Try this and let me know.
@@ -2146,7 +2155,10 @@ data_transfer_init (st_parameter_dt *dtp /* Required for compatibility between 4.3 and 4.4 runtime. Check to see if we might be reading what we wrote before */ if (dtp->u.p.current_unit->mode == WRITING) - flush(dtp->u.p.current_unit->s); + { + fbuf_flush (dtp->u.p.current_unit, 1); + flush(dtp->u.p.current_unit->s); + } if (dtp->pos < file_length (dtp->u.p.current_unit->s)) dtp->u.p.current_unit->endfile = NO_ENDFILE; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38430