This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, libgfortran] PR29752 [4.2/4.3 Regression] write(*,*,advance='NO'), READ(): Data not flushed
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 08 Nov 2006 18:42:59 -0800
- Subject: [patch, libgfortran] PR29752 [4.2/4.3 Regression] write(*,*,advance='NO'), READ(): Data not flushed
Hi all,
The attached patch I will commit to trunk and 4.2 under the simple and obvious rule.
Regression tested on i686-linux.
Hmm, we should have had a test case for this. I will add one.
Jerry
2006-11-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29752
* io/transfer.c (finalize_transfer): Flush on ADVANCE_NO.
Index: io/transfer.c
===================================================================
*** io/transfer.c (revision 118576)
--- io/transfer.c (working copy)
*************** finalize_transfer (st_parameter_dt *dtp)
*** 2359,2367 ****
dtp->u.p.current_unit->current_record = 0;
- if (dtp->u.p.advance_status == ADVANCE_NO)
- return;
-
if (!is_internal_unit (dtp) && dtp->u.p.seen_dollar)
{
dtp->u.p.seen_dollar = 0;
--- 2359,2364 ----
*************** finalize_transfer (st_parameter_dt *dtp)
*** 2369,2374 ****
--- 2366,2377 ----
return;
}
+ if (dtp->u.p.advance_status == ADVANCE_NO)
+ {
+ flush (dtp->u.p.current_unit->s);
+ return;
+ }
+
next_record (dtp, 1);
sfree (dtp->u.p.current_unit->s);
}