g77 bug
Tony Willis
Tony.Willis@hia.nrc.ca
Thu Jul 30 21:06:00 GMT 1998
Hello:
I am using the following version of g77 from egcs 1.0.3
g77 -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
to compile some really ugly code adapted from the fftpak library for
doing ffts.
If I compile the following piece of code (cut out from the original
and pared down to a bare minumum) with
g77 -c -fugly
SUBROUTINE DEFFT1 (N,WA,IFAC)
DOUBLE PRECISION WA(1), ARG1, ARGH, CH1, CH1H, DCH1, DSH1, SH1,
1 TPI
INTEGER IFAC(1), NTRYH(4)
DATA NTRYH(1), NTRYH(2), NTRYH(3), NTRYH(4) /4, 2, 3, 5/
DATA TPI / 6.2831853071 7958647692 5286766559 00577D0/
C
NL = N
RETURN
END
SUBROUTINE DEFFTI (N,WSAVE)
DOUBLE PRECISION WSAVE(*)
C
IF (N .EQ. 1) RETURN
C
CALL DEFFT1 (N,WSAVE(2*N+1),WSAVE(3*N+1))
C
RETURN
END
I get the following messages, which treat the difference in
type of variables WSAVE and IFAC as an error:
f771: warning: -fugly is overloaded with meanings and likely to be removed;
f771: warning: use only the specific -fugly-* options you need
temp.f: In subroutine `deffti':
temp.f:2:
SUBROUTINE DEFFT1 (N,WA,IFAC)
1
temp.f:18: (continued):
CALL DEFFT1 (N,WSAVE(2*N+1),WSAVE(3*N+1))
2
Argument #3 (named `ifac') of `defft1' is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS]
Hoever if I reverse the order and put SUBROUTINE DEFFTI first in the code:
SUBROUTINE DEFFTI (N,WSAVE)
DOUBLE PRECISION WSAVE(*)
C
IF (N .EQ. 1) RETURN
C
CALL DEFFT1 (N,WSAVE(2*N+1),WSAVE(3*N+1))
C
RETURN
END
SUBROUTINE DEFFT1 (N,WA,IFAC)
DOUBLE PRECISION WA(1), ARG1, ARGH, CH1, CH1H, DCH1, DSH1, SH1,
1 TPI
INTEGER IFAC(1), NTRYH(4)
DATA NTRYH(1), NTRYH(2), NTRYH(3), NTRYH(4) /4, 2, 3, 5/
DATA TPI / 6.2831853071 7958647692 5286766559 00577D0/
C
NL = N
RETURN
END
and then compile I get only a warning, and the compiler produces a .o
file, as it should, since this really ugly construct was allowed in f66.
f771: warning: -fugly is overloaded with meanings and likely to be removed;
f771: warning: use only the specific -fugly-* options you need
temp.f: In subroutine `defft1':
temp.f:6: warning:
CALL DEFFT1 (N,WSAVE(2*N+1),WSAVE(3*N+1))
1
temp.f:11: (continued):
SUBROUTINE DEFFT1 (N,WA,IFAC)
2
Argument #3 (named `ifac') of `defft1' is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS]
According to me g77 should have produced just a warning in both these
cases.
Cheers,
Tony
--
Tony Willis
Internet : Tony.Willis@hia.nrc.ca obsolete: twillis@drao.nrc.ca
Snailnet : Dominion Radio Astrophysical Observatory
P.O. Box 248, Penticton, BC, Canada V2A 6K3
BC Tel net: (250) 493-2277 Faxnet : (250) 493-7767
voicemailnet: (250) 490-4343 Localnet : ext 343
More information about the Gcc-bugs
mailing list