From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28680 invoked by alias); 9 Jan 2014 00:26:58 -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 28629 invoked by uid 48); 9 Jan 2014 00:26:55 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/59727] [4.7/4.8/4.9 Regression] reading from character string returns end of file Date: Thu, 09 Jan 2014 00:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 4.6.2 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg00855.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59727 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to Dominique d'Humieres from comment #1) > This is due to r166180: >=20 > Author: jb > Date: Tue Nov 2 12:56:38 2010 UTC (3 years, 2 months ago) > Changed paths: 4 > Log Message: PR 45629 Remove usage of setjmp/longjmp Note, it may not be a regression, but I need to find time to go read the standard. Consider the modified program: CHARACTER*40 LINE, msg LINE(1:20)=3D' 12,30.0,10.5,0 ' print *, '>',trim(line),'<' READ (LINE,*,err=3D10,iomsg=3Dmsg) I1,R1,R2,I2 WRITE (*,1000) I1,R1,R2,I2 10 print *, i1, r1, r2, i1, msg 1000 FORMAT (I4,2F10.1,I4) END troutmask:sgk[206] gfc4x -o z p.f && ./z > 12,30.0,10.5,0 @=C3=95=C3=BF=C3=BF=C3=BF< At line 8 of file p.f Fortran runtime error: End of file After the assignment to line(1:20), I don't remember if the standard requires the remaining space to be blank padded. The problem is that line(21:40) contains whatever is in memory as demonstrated by the 'print *,...' statement. I suspect that we are missing a eat_line() (or whatever the function is named). One workaround is to set line=3D'' as the first line of code. >>From gcc-bugs-return-439714-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 09 00:29:21 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 30422 invoked by alias); 9 Jan 2014 00:29:21 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 30383 invoked by uid 48); 9 Jan 2014 00:29:18 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/59727] [4.7/4.8/4.9 Regression] reading from character string returns end of file Date: Thu, 09 Jan 2014 00:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 4.6.2 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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-01/txt/msg00856.txt.bz2 Content-length: 141 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59727 --- Comment #3 from kargl at gcc dot gnu.org --- Note this might be related to PR 59700.