[Bug fortran/56735] New: Namelist Read Error with question marks

2013-03-26 Thread madawilliams at gmail dot com


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



 Bug #: 56735

   Summary: Namelist Read Error with question marks

Classification: Unclassified

   Product: gcc

   Version: 4.6.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: fortran

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: madawilli...@gmail.com





Hi,



This is my first ever bug report so apologies if i miss some vital piece of

information. I have some legacy code which compiles and runs with versions of

gfortran up to 4.5. However after this the code compiles and runs but the

namelist is not read correctly. There is no IO errors but non of the variables

are set to their respective values. I have managed to narrow this down to the

fact that the legacy namelist has question marks in the namelist file outside

of any data block. Below is a very simple code and namelist which shows this.

If you remove the question mark from the name list the values are set,

otherwise they are not.



-test.f

PROGRAM TEST



INTEGER int1,int2,int3



NAMELIST /temp/ int1,int2,int3



OPEN (53,FILE='test.nam',STATUS='OLD', IOSTAT=istat)

READ (53,temp)

WRITE(*, temp)

PRINT*, istat

END PROGRAM



-test.nam

  ? 



 $temp

  int1=1

  int2=2

  int3=3

 $END



I understand this might be non standard formatting for the namelist file, but

as I said it works with gfortran <4.6 so seems like a regression.


[Bug fortran/56735] Namelist Read Error with question marks

2013-03-26 Thread madawilliams at gmail dot com


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



--- Comment #2 from Adam Williams  2013-03-26 
10:26:43 UTC ---

Hi Dominique



Cheers for the quick response. Here is my gfortran -v info:



Using built-in specs.

COLLECT_GCC=gfortran

COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin11/4.6.2/lto-wrapper

Target: x86_64-apple-darwin11

Configured with: ../gcc-4.6.2-RC-20111019/configure

--prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64

--enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin11

Thread model: posix

gcc version 4.6.2 20111019 (prerelease) (GCC) 



With the question mark in the namelist file i get the following output:



&TEMP

 INT1=   17252416,

 INT2=  32767,

 INT3= 1589168960,

 /

   0


[Bug fortran/56735] [4.6/4.7/4.8/4.9 Regression] Namelist Read Error with question marks

2013-03-26 Thread madawilliams at gmail dot com


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



--- Comment #5 from Adam Williams  2013-03-26 
12:14:01 UTC ---

Cheers Dominique,



Unfortunately the code in question is ~25years old with an existing user base

and the namelist is used to set a vast number of initial conditions for varying

simulation runs. However, I will definitely suggest that we try move to a

standard conforming namelist.


[Bug fortran/56735] [4.6/4.7/4.8/4.9 Regression] Namelist Read Error with question marks

2013-03-30 Thread madawilliams at gmail dot com


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



--- Comment #9 from Adam Williams  2013-03-30 
18:42:44 UTC ---

This is great. I look forward to testing when I get a chance to build from the

latest dev branch. I understand what you mean with the "?", however they are

being used in a completely non-standard way in the legacy code in question.

They are actually being used as a marker in some formatted text which is kept

at the top of a namelist file and read in separately. I will see if we can

alter this, but unfortunately it is not my decision and backwards compatibility

will need to be considered.



Cheers for all your help/work


[Bug fortran/56735] [4.6/4.7/4.8/4.9 Regression] Namelist Read Error with question marks

2013-04-04 Thread madawilliams at gmail dot com


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



--- Comment #14 from Adam Williams  2013-04-04 
08:41:32 UTC ---

Thanks for all your help