From patchwork Wed Feb 10 02:45:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 581287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2B710140761 for ; Wed, 10 Feb 2016 13:46:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Yqv749Jl; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Ja5R08VV6CXIY0doCG1gzPvDj825OoabXOXB4V7o5V0t3WsMqG TDFqWmMtJf/5/Oxq6hkSE5PzuwZ92WMeO9FU1XT1IJH2nu2t3Hi5Dnct5N75eurQ etxWWZg0ouQGiZ1FAU4hFkiF/x07vgwku6ss+YffNgC7eVBoOEl+NyA5Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=HhseWUaQsZAx839gojbH19Kyjc8=; b=Yqv749JlCHoSD7dDQkP1 hmPjy8ruPNp1NuVkgoG3F8KVOMhrTtqjJwSP5nlEIyCPy0BrWG7V4/5WoQMF/mPA Uuj84zzDM/28t77nhomINaJn7bvk7Mf7y14Prpivmuvtba7ficQADKGOpMwNm3ff SrRO076AZ0L0aG59ViERu8E= Received: (qmail 67446 invoked by alias); 10 Feb 2016 02:45:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 67426 invoked by uid 89); 10 Feb 2016 02:45:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_20, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=ane, NONE, 1711, 17, 11 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mtaout005-public.msg.strl.va.charter.net Received: from mtaout005-public.msg.strl.va.charter.net (HELO mtaout005-public.msg.strl.va.charter.net) (68.114.190.30) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Feb 2016 02:45:51 +0000 Received: from impout006 ([68.114.189.21]) by mtaout005.msg.strl.va.charter.net (InterMail vM.9.00.021.00 201-2473-182) with ESMTP id <20160210024549.LCO21278.mtaout005.msg.strl.va.charter.net@impout006>; Tue, 9 Feb 2016 20:45:49 -0600 Received: from quattro.localdomain ([96.41.215.23]) by impout006 with charter.net id GSlo1s00H0Wrkg001Slpkn; Tue, 09 Feb 2016 20:45:49 -0600 X-Authority-Analysis: v=2.1 cv=N8anFgNB c=1 sm=1 tr=0 a=salB9WdMPIDduBH7JsZfrA==:117 a=salB9WdMPIDduBH7JsZfrA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=mDV3o1hIAAAA:8 a=DF-iwuYYIan4a9vyApIA:9 a=QEXdDO2ut3YA:10 a=fuJGvJl3sNt0fOt5U_sA:9 a=oGeBvYIiMaqwm-P-:21 a=GtTxtgPDud5xla6m:21 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 To: gfortran Cc: gcc patches From: Jerry DeLisle Subject: [patch, libgfortran] Bug 69668 - [4.9/5/6 Regression] Error reading namelist opened with DELIM='NONE' X-Enigmail-Draft-Status: N1110 Message-ID: <56BAA45C.9020203@charter.net> Date: Tue, 9 Feb 2016 18:45:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 The attached patch reverts the guilty code. We were trying to honor delim=NONE on namelist reads which is invalid. Test cases updated. Regression tested on x86-64. OK for trunk and back port in about a week? Regards, Jerry 2016-02-09 Jerry DeLisle PR libgfortran/69668 * io/list_read.c (read_character): Remove code related to DELIM_NONE. 2016-02-09 Jerry DeLisle PR libgfortran/69668 * gfortran.dg/nanelist_38.f90: Update test. * gfortran.dg/nanelist_84.f90: Update test. diff --git a/gcc/testsuite/gfortran.dg/namelist_38.f90 b/gcc/testsuite/gfortran.dg/namelist_38.f90 index 5578654e..1da41c09 100644 --- a/gcc/testsuite/gfortran.dg/namelist_38.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_38.f90 @@ -5,6 +5,7 @@ program main implicit none character(len=3) :: a + character(25) :: b namelist /foo/ a open(10, status="scratch", delim="quote") @@ -25,12 +26,16 @@ program main if (a.ne."a'a") call abort close (10) - open(10, status="scratch", delim="none") + open(10, delim="none") a = "a'a" write(10,foo) - rewind 10 - a = "" - read (10,foo) - if (a.ne."a'a") call abort close (10) + open(10) + read(10,"(a)") b + if (b .ne. "&FOO") call abort + read(10,"(a)") b + if (b .ne. " A=a'a") call abort + read(10,"(a)") b + if (b .ne. " /") call abort + close(10, status="delete") end program main diff --git a/gcc/testsuite/gfortran.dg/namelist_84.f90 b/gcc/testsuite/gfortran.dg/namelist_84.f90 index af139d91..14b68a44 100644 --- a/gcc/testsuite/gfortran.dg/namelist_84.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_84.f90 @@ -17,12 +17,11 @@ program namelist_delim_none write(10, mylist) rewind(10) mystring = "xxxxx" - read(10,mylist) - if (any(mystring /= (/ 'mon', 'tue', 'wed', 'thu', 'fri' /))) call abort rewind(10) do i=1,5 read(10,'(a)') internal_unit - if (scan(internal_unit,"""'").ne.0) call abort + if (i.eq.2 .and. internal_unit .ne. " MYSTRING=mon tue wed thu fri ,") call abort + if (scan(internal_unit,"""'").ne.0) print *, internal_unit end do close(10) end program diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 052219be..efbbcb6c 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1131,21 +1131,6 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused))) default: if (dtp->u.p.namelist_mode) { - if (dtp->u.p.current_unit->delim_status == DELIM_NONE) - { - /* No delimiters so finish reading the string now. */ - int i; - push_char (dtp, c); - for (i = dtp->u.p.ionml->string_length; i > 1; i--) - { - if ((c = next_char (dtp)) == EOF) - goto done_eof; - push_char (dtp, c); - } - dtp->u.p.saved_type = BT_CHARACTER; - free_line (dtp); - return; - } unget_char (dtp, c); return; }