[Bug fortran/73142] New: Reading a namelist fails - my code worked until 4.8.2

2016-08-10 Thread gwebe...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=73142

Bug ID: 73142
   Summary: Reading a namelist fails - my code worked until 4.8.2
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gwebe...@t-online.de
  Target Milestone: ---

Created attachment 39129
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39129&action=edit
Minimum example

Hi folks,

I am using the GCC package for Windows provided by www.equation.com. It looks
like after version 4.8.2 a bug was introduced in the reading of namelists. The
reading is rubbish when the data file has a certain format. But at least in
Windows when you open the data file in a common editor you see identical
content to a version of the data file, which can be read correctly.

Attached please find the minimum example of my code. FileA.dat will work,
FileB.dat doesn't. There is no such problem when using GCC 4.8.2 and older
versions.
That the bug was introduced is a pity because the code that does not work right
now is part of a major Monte Carlo program used in high energy physics.

I would really appreciate if someone could fix this issue.

Sincerely,
Günter

[Bug fortran/73142] Reading a namelist fails - my code worked until 4.8.2

2016-08-10 Thread gwebe...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=73142

--- Comment #2 from Günter Weber  ---
Dear Harald,

no, I wasn't aware of that. But using "/" does not fix the issue.

Maybe it is instructive to look at the code that produces a data file which
will then fail when you try to read it using namelist. (In the minimum example
I considered only QCAP, as the error occurs already there).

  subroutine wtscpr
  implicit none
  integer i, j
  include 'pegscommons/cpcom.f'
  open(UNIT=31,FILE='pgs5job.ssl',STATUS='unknown')
  write(31,'(1H ,A)') '&SCPRDT'
  write(31,'(1H ,A)') 'QCAP='
  write(31,'((1H ,7(F9.2,A)))') (QCAP(I),',',I=1,31)
  write(31,'(1H ,A,I5)') 'MXRAW=',MXRAW
  Write(31,'(1H ,A)') 'ELECNI='
  write(31,'((1H ,7(1PE9.3,A)))') (ELECNI(I),',',I=1,MXRAW)
  write(31,'(1H ,A,I5)') 'MXSHEL=',MXSHEL
  write(31,'(1H ,A)') 'NSHELL='
  write(31,'((1H ,14(I4,A)))') (NSHELL(I),',',I=1,MXRAW)
  write(31,'(1H ,A)') 'CAPIN='
  write(31,'((1H ,5(1PE11.5,A)))') (CAPIN(I),',',I=1,MXRAW)
  write(31,'(1H ,A)') 'SCPROF='
  do i=1,MXRAW+1
write(31,'((1H ,7(1PE9.3,A)))') (SCPROF(j,i),',',j=1,31)
  end do
  write(31,'(1H ,A)') '/END'
  endfile 31
  close(31)
  return
  end

[Bug fortran/73142] Reading a namelist fails - my code worked until 4.8.2

2016-08-10 Thread gwebe...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=73142

--- Comment #4 from Günter Weber  ---
This means the issue is already solved and will be fixed in a 'standard' GCC
release in the future?