public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ
@ 2004-09-02 13:41 paul dot richard dot thomas at cea dot fr
  2004-09-08 18:57 ` [Bug fortran/17286] " toon at moene dot indiv dot nluug dot nl
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2004-09-02 13:41 UTC (permalink / raw)
  To: gcc-bugs

Example below - 1st namelist can be read but second, in output format, cannot.  
>From a bit of exploration, I find that a namelist containing more than one 
value cannot contain whitespace or newlines. 

$ cat bug3.f90;/irun/bin/gfortran -v bug3.f90 ; ./a.exe
program bug3
  integer :: num1 , num2 , num3 =42 , num4 = 56
  namelist /mynml1/ num1,num2
  namelist /mynml2/ num3,num4
  open(unit=10,file='bug3.txt',status='unknown')
  write(10,'(A)') "&mynml1,num1=16,num2=32,&end"
!
! write mynml2
!
  write(10,mynml2)
  close(10)
!
! now read back
!
  open(unit=10,file='bug3.txt',status='old')
  read(10,mynml1)
  print *, "1st READ is OK"
  write(*,mynml1)
  read(10,mynml2)
  print *, "2nd READ is OK"
  write(*,mynml2)
  close(10)
end program bug3
Driving: /irun/bin/gfortran -v bug3.f90 -lgfortranbegin -lgfortran
Reading specs from /irun/lib/gcc/i686-pc-cygwin/3.5.0/specs
Configured with: ../gcc-3.5-20040815/configure --with-gmp=/gmp --with-mpfr=/gmp
--prefix=/irun --enable-languages=c,c++,f95
Thread model: single
gcc version 3.5.0 20040815 (experimental)
 /irun/libexec/gcc/i686-pc-cygwin/3.5.0/f951.exe bug3.f90 -quiet -dumpbase bug3.
f90 -mtune=pentiumpro -auxbase bug3 -version -o /cygdrive/c/DOCUME~1/THOMASP/LOC
ALS~1/Temp/cciuEhJj.s
GNU F95 version 3.5.0 20040815 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 3.5.0 20040719 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -o /cygdrive/c/DOCUME~1/THOMASP/LOCALS~1/Temp/ccNr91Rn.o /cygdrive/c/DOCUME~
1/THOMASP/LOCALS~1/Temp/cciuEhJj.s
 /irun/libexec/gcc/i686-pc-cygwin/3.5.0/collect2.exe -Bdynamic --dll-search-pref
ix=cyg /lib/crt0.o -L/irun/lib/gcc/i686-pc-cygwin/3.5.0 -L/irun/lib/gcc/i686-pc-
cygwin/3.5.0/../../.. /cygdrive/c/DOCUME~1/THOMASP/LOCALS~1/Temp/ccNr91Rn.o -lgf
ortranbegin -lgfortran -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -
lgcc
 1st READ is OK
&mynml1
num1=         16,num2=         32,/
At line 20 of file bug3.f90
Internal Error: Can not match a namelist variable

-- 
           Summary: namelist containing more than one value cannot contain
                    whitespace or newlines for READ
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul dot richard dot thomas at cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org,paulthomas2 at wanadoo
                    dot fr


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


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

* [Bug fortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
@ 2004-09-08 18:57 ` toon at moene dot indiv dot nluug dot nl
  2004-09-13  2:23 ` [Bug libfortran/17286] " bdavis at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2004-09-08 18:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From toon at moene dot indiv dot nluug dot nl  2004-09-08 18:57 -------
Confirmed on powerpc-unknown-linux-gnu, using gcc-3.5-20040907.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-08 18:57:51
               date|                            |


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
  2004-09-08 18:57 ` [Bug fortran/17286] " toon at moene dot indiv dot nluug dot nl
@ 2004-09-13  2:23 ` bdavis at gcc dot gnu dot org
  2004-09-21  2:34 ` bdavis at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-09-13  2:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-09-13 02:23 -------
just some info found debugging :

in namelist_read:

          name_matched = 1;
          nl = find_nml_node (saved_string);
          if (nl == NULL)
            internal_error ("Can not match a namelist variable");

saved string is equal to the previous data value as well as the variable, so it
will never match.

searching for num3
searching for 42num4
              ^^
              this is the value for num3

possible fix is to clear out saved_string before the variable name is parsed,
maybe here:

        case '\n':
        case '\t':
          break;
        case ',':
          free_saved ();
          next_name = 1;
          break;
                                                                                
my time is limited, so i may not get back to this for a few weeks.  hope it is
helpfull to someone.

--bud 



-- 


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
  2004-09-08 18:57 ` [Bug fortran/17286] " toon at moene dot indiv dot nluug dot nl
  2004-09-13  2:23 ` [Bug libfortran/17286] " bdavis at gcc dot gnu dot org
@ 2004-09-21  2:34 ` bdavis at gcc dot gnu dot org
  2004-09-21  3:01 ` bdavis at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-09-21  2:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-09-21 02:34 -------
like most initial attempts at debugging, the above is wrong :)

please ignore the above.

--bud

-- 


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
                   ` (2 preceding siblings ...)
  2004-09-21  2:34 ` bdavis at gcc dot gnu dot org
@ 2004-09-21  3:01 ` bdavis at gcc dot gnu dot org
  2004-09-21 11:23 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-09-21  3:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-09-21 03:01 -------
proposed patch:

http://gcc.gnu.org/ml/fortran/2004-09/msg00187.html

-- 


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
                   ` (3 preceding siblings ...)
  2004-09-21  3:01 ` bdavis at gcc dot gnu dot org
@ 2004-09-21 11:23 ` cvs-commit at gcc dot gnu dot org
  2004-09-21 12:42 ` tobi at gcc dot gnu dot org
  2004-09-21 12:53 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-21 11:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-21 11:22 -------
Subject: Bug 17286

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bdavis@gcc.gnu.org	2004-09-21 11:22:48

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/io : list_read.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: pr17286.f90 

Log message:
	2004-09-21  Bud Davis  <bdavis9659@comcast.net>
	
	PR fortran/17286
	* io/list_read.c (namelist_read): ignore spaces after
	the '=' for namelist reads.
	
	2004-09-21  Bud Davis  <bdavis9659@comcast.net>
	
	PR fortran/17286
	* gfortran.dg/pr17286.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.90&r2=1.91
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/list_read.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4324&r2=1.4325
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr17286.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
                   ` (4 preceding siblings ...)
  2004-09-21 11:23 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-21 12:42 ` tobi at gcc dot gnu dot org
  2004-09-21 12:53 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-09-21 12:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-21 12:42 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bdavis at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug libfortran/17286] namelist containing more than one value cannot contain whitespace or newlines for READ
  2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
                   ` (5 preceding siblings ...)
  2004-09-21 12:42 ` tobi at gcc dot gnu dot org
@ 2004-09-21 12:53 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-21 12:53 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2004-09-21 12:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-02 13:41 [Bug fortran/17286] New: namelist containing more than one value cannot contain whitespace or newlines for READ paul dot richard dot thomas at cea dot fr
2004-09-08 18:57 ` [Bug fortran/17286] " toon at moene dot indiv dot nluug dot nl
2004-09-13  2:23 ` [Bug libfortran/17286] " bdavis at gcc dot gnu dot org
2004-09-21  2:34 ` bdavis at gcc dot gnu dot org
2004-09-21  3:01 ` bdavis at gcc dot gnu dot org
2004-09-21 11:23 ` cvs-commit at gcc dot gnu dot org
2004-09-21 12:42 ` tobi at gcc dot gnu dot org
2004-09-21 12:53 ` pinskia at gcc dot gnu dot 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).