From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3128 invoked by alias); 13 May 2009 13:47:23 -0000 Received: (qmail 3081 invoked by uid 48); 13 May 2009 13:47:08 -0000 Date: Wed, 13 May 2009 13:47:00 -0000 Message-ID: <20090513134708.3080.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/39782] [4.3/4.4 Regression] IO depends on uninitialised value In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg01100.txt.bz2 ------- 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