This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.4.0 Fortran Fix] Fix for PR fortran 12884 installed on 3.4.0 branch.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 31 Jan 2004 15:24:02 +0100
- Subject: [3.4.0 Fortran Fix] Fix for PR fortran 12884 installed on 3.4.0 branch.
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
L.S.,
I installed the following fix to problem report fortran/12884 and test
case on the 3.4.0 branch after bootstrap and make check (Fortran) on
powerpc-unknown-linux-gnu.
Both the fix and the test case were written by Bud Davis - Thanks !
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)
2004-01-31 Bud Davis <bdavis9659@comcast.net>
PR fortran/12884
* libI77/rsne.c: Enable reading a '/' when reading
a '$' delimited namelist.
*** gcc/libf2c/libI77/rsne.c 31 Aug 2002 14:38:57 -0000 1.12
--- gcc/libf2c/libI77/rsne.c 28 Dec 2003 00:56:55 -0000
*************** x_rsne (cilist * a)
*** 278,283 ****
--- 278,284 ----
char *vaddr;
long iva, ivae;
dimen dimens[MAXDIM], substr;
+ int dollarsign_delimited;
if (!Alpha['a'])
nl_init ();
*************** x_rsne (cilist * a)
*** 285,298 ****
f__formatted = 1;
got1 = 0;
top:
for (;;)
switch (GETC (ch))
{
case EOF:
eof:
err (a->ciend, (EOF), where0);
- case '&':
case '$':
goto have_amp;
#ifndef No_Namelist_Questions
case '?':
--- 286,301 ----
f__formatted = 1;
got1 = 0;
top:
+ dollarsign_delimited = 0;
for (;;)
switch (GETC (ch))
{
case EOF:
eof:
err (a->ciend, (EOF), where0);
case '$':
+ dollarsign_delimited = 1;
+ case '&':
goto have_amp;
#ifndef No_Namelist_Questions
case '?':
*************** have_amp:
*** 329,334 ****
--- 332,339 ----
case EOF:
err (a->ciend, EOF, where0);
case '/':
+ if (dollarsign_delimited)
+ continue;
case '&':
case '$':
if (f__external)
IMPLICIT NONE
C properly handle a "/" in a $<NAME> $END namelist
C pr12884 --
C error in reading a namelist when it is preceded by a line with a SLASH
C
CHARACTER*80 DL(7)
DATA DL /'$file',
1 'oms omsmc.i2',
2 'pseu pseudo/PSN',
3 '$end',
4 '$CNTRL',
5 'ispher=1,NOSYM=2,RUNFLG=3,noprop=4,',
6 '$END'/
C $file is not a valid namelist, but it still
C is parsed by the runtime
INTEGER*4 ISPHER,NOSYM,RUNFLG,NOPROP /-1 /
INTEGER I
NAMELIST /CNTRL/ ISPHER,NOSYM,RUNFLG,NOPROP
C make a unique datafile
OPEN(UNIT=9,STATUS='SCRATCH')
WRITE(9,*,ERR=100)(DL(I),I=1,7)
REWIND(9)
READ(9,NML=CNTRL,ERR=100)
CLOSE(9)
IF (ISPHER.NE.1.OR.NOSYM.NE.2.OR.RUNFLG.NE.3.OR.NOPROP.NE.4)THEN
CALL ABORT
ENDIF
C all is well at this point !!
STOP
100 PRINT*,'FILE ERROR(S)'
CALL ABORT
END