[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #5 from jvdelisle at gcc dot gnu dot org 2008-11-15 19:27 --- Subject: Bug 37294 Author: jvdelisle Date: Sat Nov 15 19:25:35 2008 New Revision: 141892 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141892 Log: 2008-11-15 Jerry DeLisle [EMAIL PROTECTED] PR libfortran/37294 * io/write.c (namelist_write_newline): Use array loop specification to advance to next internal array unit record. (namelist_write): Adjust to accomodate the internal array unit behavior. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/write.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #6 from jvdelisle at gcc dot gnu dot org 2008-11-15 19:34 --- Subject: Bug 37294 Author: jvdelisle Date: Sat Nov 15 19:33:07 2008 New Revision: 141893 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141893 Log: 2008-11-15 Jerry DeLisle [EMAIL PROTECTED] PR libfortran/37294 * gfortran.dg/namelist_57.f90: New test. * gfortran.dg/namelist_print_1.f: Adjust test conditions. Added: trunk/gcc/testsuite/gfortran.dg/namelist_57.f90 Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/namelist_print_1.f -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #7 from jvdelisle at gcc dot gnu dot org 2008-11-15 19:39 --- Fixed on trunk. I will open a new PR for enhancement of this to better utilize the internal unit array by doing fewer newlines for namelists. -- jvdelisle at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #4 from burnus at gcc dot gnu dot org 2008-11-13 15:55 --- Patch was: http://gcc.gnu.org/ml/fortran/2008-11/msg00080.html I'm not completely satisfied with the patch it will break code such as: character(50) :: line(2) namelist /stuff/ n, m n = 123 m = 456 write(line,nml=stuff) which worked before. The true solution would be to do the same as NAG f95 does (cf. comment 2), but the challenge is to do is such that there is no performance penalty for code which fits into one line / for scalars. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #3 from jvdelisle at gcc dot gnu dot org 2008-11-13 06:06 --- A patch has been submitted for review. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #2 from burnus at gcc dot gnu dot org 2008-08-31 09:11 --- 9.3 Internal files (2) A record of an internal file is a scalar character variable. (3) If the file is a scalar character variable, it consists of a single record whose length is the same as the length of the scalar character variable. If the file is a character array, it is treated as a sequence of character array elements. I'm not sure that one necessarily has always to write: 1)STUFF 2)N=123, 3)/ I think NAG f95 does it standard conform and sensible: With: character(30) :: line(3) 1) STUFF N = 123/ 2) 3) With: character(10) :: line(3) ! or 15 1) STUFF 2) N = 123/ 3) With: character(9) :: line(3) 1) STUFF 2) N = 123 3) / With: character(8) :: line(3) 1) STUFF 2) N = 3) 123/ gfortran (and g95) print: Fortran runtime error: End of record when the data does not fit into a single record/array element. (I don't know how to decide without to many CPU cycles when to start a new record.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294
[Bug libfortran/37294] Namelist I/O to array character internal units
--- Comment #1 from jvdelisle at gcc dot gnu dot org 2008-08-31 00:24 --- Correction. -std=f95 disallows it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37294