The following testcase illustrates the issue. Reported here: http://gcc.gnu.org/ml/fortran/2008-06/msg00149.html program check1 real x namelist/casein/x read(1,casein) print*,x end fort.1 contains: &CASEIN x=1. / Two tabs precede x.
I will work this.
The following patch fixes this: Index: list_read.c =================================================================== --- list_read.c (revision 136763) +++ list_read.c (working copy) @@ -2922,6 +2922,8 @@ find_nml_name: goto find_nml_name; } + eat_separator (dtp); + /* Ready to read namelist objects. If there is an error in input from stdin, output the error message and continue. */ I will commit as obvious after completing regression tests. Passes al namelist tests we have.
Subject: Bug 36538 Author: jvdelisle Date: Sat Jun 14 04:30:48 2008 New Revision: 136776 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136776 Log: 2008-06-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36538 * io/list_read.c (namelist_read): Add eat_separator to eliminate leading tabs. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c
Subject: Bug 36538 Author: jvdelisle Date: Sat Jun 14 04:39:11 2008 New Revision: 136777 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136777 Log: 2008-06-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36538 * gfortran.dg: namelist_48.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/namelist_48.f90 Modified: trunk/gcc/testsuite/ChangeLog
That was quick.
Jerry, does the 4.3 branch also need this fix?
yes, we could think of it as a regression relative to g77
Subject: Bug 36538 Author: jvdelisle Date: Sat Jun 14 17:57:55 2008 New Revision: 136784 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136784 Log: 2008-06-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36538 Backport from trunk. * io/list_read.c (namelist_read): Add eat_separator to eliminate leading tabs. Modified: branches/gcc-4_3-branch/libgfortran/ChangeLog branches/gcc-4_3-branch/libgfortran/io/list_read.c
Subject: Bug 36538 Author: jvdelisle Date: Wed Jul 2 04:52:47 2008 New Revision: 137337 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137337 Log: 2008-07-01 Jerry DeLisle <jvdelisle@gcc.gnu.org PR fortran/36676 PR fortran/36657 PR fortran/36546 PR fortran/36538 * gfortran.dg/namelist_50.f90 * gfortran.dg/namelist_51.f90 * gfortran.dg/namelist_48.f90 * gfortran.dg/namelist_49.f90 Added: branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/namelist_48.f90 branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/namelist_49.f90 branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/namelist_50.f90 branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/namelist_51.f90 Modified: branches/gcc-4_3-branch/gcc/testsuite/ChangeLog