public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "w6ws at earthlink dot net" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-55117-4-VmQnqov8Pb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55117-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55117

--- Comment #6 from Walter Spector <w6ws at earthlink dot net> 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.  :) )


  parent reply	other threads:[~2013-01-04 14:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 14:31 [Bug fortran/55117] New: " pmarguinaud at hotmail dot com
2012-10-29 14:32 ` [Bug fortran/55117] " pmarguinaud at hotmail dot com
2012-10-29 14:34 ` pmarguinaud at hotmail dot com
2012-10-29 16:03 ` janus at gcc dot gnu.org
2012-10-31 19:53 ` burnus at gcc dot gnu.org
2013-01-04  2:54 ` w6ws at earthlink dot net
2013-01-04 14:33 ` w6ws at earthlink dot net [this message]
2013-01-04 16:59 ` kargl at gcc dot gnu.org
2013-01-04 17:22 ` w6ws at earthlink dot net
2013-01-05 19:16 ` jvdelisle at gcc dot gnu.org
2013-01-06 18:51 ` jvdelisle at gcc dot gnu.org
2013-02-22 20:58 ` tilo@tilo-schwarz.de
2013-02-22 22:40 ` tilo@tilo-schwarz.de
2013-02-24  0:28 ` tilo@tilo-schwarz.de
2013-02-25  1:00 ` tilo@tilo-schwarz.de
2013-02-25  1:03 ` tilo@tilo-schwarz.de
2013-02-25 19:02 ` tilo@tilo-schwarz.de
2013-02-25 19:49 ` mikael at gcc dot gnu.org
2013-02-25 20:29 ` tilo@tilo-schwarz.de
2013-03-22 10:10 ` burnus at gcc dot gnu.org
2013-03-30  3:54 ` jvdelisle at gcc dot gnu.org
2013-03-30  5:05 ` jvdelisle at gcc dot gnu.org
2013-04-25 12:42 ` burnus at gcc dot gnu.org
2013-06-16 18:04 ` dominiq at lps dot ens.fr
2014-03-23 23:20 ` jvdelisle at gcc dot gnu.org
2014-05-26 15:20 ` jvdelisle at gcc dot gnu.org
2014-05-26 15:33 ` jvdelisle at gcc dot gnu.org
2014-06-07 17:42 ` jvdelisle at gcc dot gnu.org
2014-06-07 17:43 ` jvdelisle at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55117-4-VmQnqov8Pb@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).