From patchwork Sat Jul 23 10:20:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 106426 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]) by ozlabs.org (Postfix) with SMTP id 1A980B6F75 for ; Sat, 23 Jul 2011 20:20:54 +1000 (EST) Received: (qmail 26510 invoked by alias); 23 Jul 2011 10:20:50 -0000 Received: (qmail 26495 invoked by uid 22791); 23 Jul 2011 10:20:49 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Jul 2011 10:20:35 +0000 Received: from [192.168.178.22] (port-92-204-19-234.dynamic.qsc.de [92.204.19.234]) by mx01.qsc.de (Postfix) with ESMTP id 2A9753CDB3; Sat, 23 Jul 2011 12:20:33 +0200 (CEST) Message-ID: <4E2AA070.1030709@net-b.de> Date: Sat, 23 Jul 2011 12:20:32 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jerry DeLisle CC: gcc patches , gfortran Subject: Re: [Patch, Fortran] PR49791 - Fix legacy namelist support References: <4E27571D.6030007@net-b.de> <4E29F543.7080501@charter.net> In-Reply-To: <4E29F543.7080501@charter.net> 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 Jerry DeLisle wrote: > I would say OK for trunk and then backport in a few weeks. If you > feel like being conservative you could use > > || (dtp->u.p.ionml->type == BT_DERIVED && !dtp->u.p.ionml->touched)) > but I do not think it is necessary. I have committed the initial patch as Rev. 176661. * * * However, the following test case still fails with the now-patched gfortran version. It worked with gfortran before the October 2010 patch - and it also works with g95, pgi and openf95/pathf95/sunf95/crayftn. The testcase is: !-------------------------- ! { dg-do run } ! ! PR fortran/49791 ! type t integer :: array(4) end type t type(t) :: a namelist /nml/a a%array = [ 1,2,3,4] open(999, status='scratch') write(999,'(a)') '&nml a%array(1) = 99, 192 /' rewind(999) read(999, nml=nml) if (any (a%array /= [ 99, 192, 3, 4])) call abort () !write(*,nml=nml) end !-------------------------- Using your patch (cf. below) fixes it - but it regresses for gfortran.dg/namelist_66.f90 (PR PR46010): Fortran runtime error: Cannot match namelist object name 'bb' That's while reading: &naml1 tracer(1) = 'aa', .true. tracer(2) = 'bb', .true. tracer(3) = 'cc', .true. / Thus, it somehow regards a quoted string - after the namelist object name - as object name! The namelist object is: type ptracer character(len = 2) :: sname logical :: lini end type ptracer type(ptracer) , dimension(3) :: tracer Tobias PS: The patch which causes the regression is: ls[dim].end = ls[dim].start; --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -2215,3 +2215,4 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad, || !(compile_options.allow_std & GFC_STD_GNU) - || dtp->u.p.ionml->type == BT_DERIVED) + || (dtp->u.p.ionml->type == BT_DERIVED + && !dtp->u.p.ionml->touched))