From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29494 invoked by alias); 6 Jun 2009 16:08:16 -0000 Received: (qmail 29471 invoked by uid 48); 6 Jun 2009 16:08:04 -0000 Date: Sat, 06 Jun 2009 16:08:00 -0000 Message-ID: <20090606160804.29470.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/40334] [4.4/4.5 Regression] changed BACKSPACE behaviour at end of file. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jvdelisle 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-06/txt/msg00337.txt.bz2 ------- Comment #4 from jvdelisle at gcc dot gnu dot org 2009-06-06 16:08 ------- In the test case, the the first EOF is generated in transfer.c (hit_eof) which sets the end file conditions. The second EOF is generated in list_read.c:1689. When returning from he error condition, the end file conditions are not set. I have regtested this rough patch. Index: list_read.c =================================================================== --- list_read.c (revision 147996) +++ list_read.c (working copy) @@ -1687,6 +1687,11 @@ list_formatted_read_scalar (st_parameter if (setjmp (eof_jump)) { generate_error (&dtp->common, LIBERROR_END, NULL); + if (!is_internal_unit (dtp)) + { + dtp->u.p.current_unit->endfile = AFTER_ENDFILE; + dtp->u.p.current_unit->current_record = 0; + } goto cleanup; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40334