Bug 36538 - namelist failure with tabs preceding object name
Summary: namelist failure with tabs preceding object name
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-14 03:27 UTC by Jerry DeLisle
Modified: 2008-06-14 13:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-06-14 03:28:27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2008-06-14 03:27:59 UTC
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.
Comment 1 Jerry DeLisle 2008-06-14 03:28:27 UTC
I will work this.
Comment 2 Jerry DeLisle 2008-06-14 03:53:41 UTC
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.
Comment 3 Jerry DeLisle 2008-06-14 04:31:34 UTC
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

Comment 4 Jerry DeLisle 2008-06-14 04:39:56 UTC
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

Comment 5 Jerry DeLisle 2008-06-14 04:40:38 UTC
That was quick.
Comment 6 Bernhard Reutner-Fischer 2008-06-14 12:23:31 UTC
Jerry, does the 4.3 branch also need this fix?
Comment 7 Jerry DeLisle 2008-06-14 13:52:31 UTC
yes, we could think of it as a regression relative to g77
Comment 8 Jerry DeLisle 2008-06-14 17:58:41 UTC
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

Comment 9 Jerry DeLisle 2008-07-02 04:53:39 UTC
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