This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/39782] [4.3/4.4 Regression] IO depends on uninitialised value
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 May 2009 13:47:08 -0000
- Subject: [Bug fortran/39782] [4.3/4.4 Regression] IO depends on uninitialised value
- References: <bug-39782-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from burnus at gcc dot gnu dot org 2009-05-13 13:47 -------
For 4.4 the equivalent diff should be the following (untested). I don't see ad
hoc whether the "sfree" can be removed as well or not.
Index: libgfortran/io/transfer.c
===================================================================
--- libgfortran/io/transfer.c (revision 147470)
+++ libgfortran/io/transfer.c (working copy)
@@ -2148,7 +2148,6 @@ data_transfer_init (st_parameter_dt *dtp
if (dtp->pos != dtp->u.p.current_unit->strm_pos)
{
fbuf_flush (dtp->u.p.current_unit, 1);
- flush (dtp->u.p.current_unit->s);
if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1) == FAILURE)
{
generate_error (&dtp->common, LIBERROR_OS, NULL);
@@ -2951,10 +2950,7 @@ finalize_transfer (st_parameter_dt *dtp)
if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED
&& file_position (dtp->u.p.current_unit->s) >= dtp->rec)
- {
- flush (dtp->u.p.current_unit->s);
- sfree (dtp->u.p.current_unit->s);
- }
+ sfree (dtp->u.p.current_unit->s);
return;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39782