From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10000 invoked by alias); 15 Mar 2014 20:32:13 -0000 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 Received: (qmail 9906 invoked by uid 55); 15 Mar 2014 20:32:06 -0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/58324] Bogus END-of-line error with list-directed I/O of file without trailing sequential record marker Date: Sat, 15 Mar 2014 20:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg01272.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58324 --- Comment #7 from Jerry DeLisle --- Author: jvdelisle Date: Sat Mar 15 20:31:33 2014 New Revision: 208595 URL: http://gcc.gnu.org/viewcvs?rev=208595&root=gcc&view=rev Log: 2014-03-15 Jerry DeLisle Backport from mainline PR libfortran/58324 PR libfortran/38199 * io/list_read.c (finish_list_read): Read one character to check for the end of the file. If it is the end, then issue the file end error message. If not, use eat_line to reach the end without giving error. The next attempt to read will then issue the error as described above. * io/read.c (read_decimal): Quickly skip spaces to avoid calls to next_char. * io/unit.c (is_trim_ok): New helper function to check various conditions to see if its OK to trim the internal unit string. (get_internal_unit): Use LEN_TRIM to shorten selected internal unit strings for optimizing READ. Enable this optimization for formatted READ. Modified: branches/gcc-4_8-branch/libgfortran/ChangeLog branches/gcc-4_8-branch/libgfortran/io/list_read.c branches/gcc-4_8-branch/libgfortran/io/read.c branches/gcc-4_8-branch/libgfortran/io/unit.c