This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]