From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11792 invoked by alias); 4 Jan 2013 14:33:37 -0000 Received: (qmail 11725 invoked by uid 48); 4 Jan 2013 14:33:17 -0000 From: "w6ws at earthlink dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55117] Programs fails to read namelist (contains derived types objects) Date: Fri, 04 Jan 2013 14:33: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-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: w6ws at earthlink dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2013-01/txt/msg00318.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55117 --- Comment #6 from Walter Spector 2013-01-04 14:33:15 UTC --- Another manifestation of this problem is with type extension. Here is another small example which fails. (Tested on v4.6.3 and also a 1/4/2013 snapshot of the 4.8 trunk.): program test_type_extension type t1_t real :: x end type t1_t type, extends(t1_t) :: t1e_t character(8) :: string end type t1e_t type(t1e_t) :: t1e integer :: answer namelist /test_NML/ t1e, answer open(unit=1,file='test1.inp') read(1,NML=test_NML) write(*,*) t1e%x, t1e%string, answer end program test_type_extension File test1.inp contains: &test_NML t1e%x = 2.,t1e%string='gfortran',answer=42 / wws@w6ws-4:~/fortran/xxx$ gfortran --version GNU Fortran (GCC) 4.8.0 20130104 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING wws@w6ws-4:~/fortran/xxx$ gfortran namelist.f90 wws@w6ws-4:~/fortran/xxx$ a.out At line 17 of file namelist.f90 (unit = 1, file = 'test1.inp') Fortran runtime error: Cannot match namelist object name %x Backtrace for this error: + in the main program from file namelist.f90 + /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ffe80c5376d] wws@w6ws-4:~/fortran/xxx$ The NAG Fortran compiler has no problems with this test case. (Intel and PGI are not so lucky. :) )