public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49597] New: gfortran namelist read bug
@ 2011-06-30 19:03 david.sagan at gmail dot com
  2011-06-30 19:32 ` [Bug fortran/49597] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: david.sagan at gmail dot com @ 2011-06-30 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: gfortran namelist read bug
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: david.sagan@gmail.com


Test program is:

program the_bug

implicit none

type example_struct
  logical logic
end type example_struct

integer readstatus
type(example_struct) fzz(3)
namelist /parameters/ fzz
!
open (unit= 10,file='the_bug.in')
read(10, nml = parameters,iostat=readstatus)
write(*,*) "iostat = ", readstatus
end program the_bug


Input file "the_bug.in" is:

&parameters 
fzz(1)%logic = .true.
fzz(2)%logic = .true.
/

bla bla bla


Running gives:

/lnx4103:~/dcs/bmad_distribution/test> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 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

lnx4103:~/dcs/bmad_distribution/test> gfortran test.f90 ; ./a.out
 iostat =         5010


iostat should be 0. 
If you delete the "bla bla bla" line you get iostat = -1. 
If you change the name of the variable from "fzz" to, say, "zz" (2 places in
the program and 2 places in the_bug.in) you get iostat as 0 as it should be.
I have not tried extensively to test this but variable names beginning with "t"
and variable names beginning with "f" show the bug and other names do not.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-27 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 19:03 [Bug fortran/49597] New: gfortran namelist read bug david.sagan at gmail dot com
2011-06-30 19:32 ` [Bug fortran/49597] " dominiq at lps dot ens.fr
2011-07-26 21:00 ` jvdelisle at gcc dot gnu.org
2011-07-27  7:06 ` burnus at gcc dot gnu.org
2011-07-27 13:44 ` david.sagan at gmail dot com
2011-07-27 14:18 ` burnus at gcc dot gnu.org

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).