Path: utzoo!utgpu!news-server.csri.toronto.edu!qucdn!gilla Newsgroups: comp.sys.mips Subject: f77 compiler bugs Date: Monday, 11 Jun 1990 01:05:05 EDT From: "Arnold G. Gill" Message-ID: <90162.010506GILLA@QUCDN.BITNET> The following source code generates the errors indicated. Our machine is a 120, running RISC(OS) 4.30. Two separate bugs are presented, both having something to do with character strings. Note that neither of these bugs was apparent in the previous f77 compiler that we had (using RISC(OS) 3.10). *** Number 1 *** program F77_Bug_5 c c ----- In this version of the compiler (released with RISC(OS) 4.30), the c value returned from the character function is not properly used in the c logical expression, even though it is correct when printed. c character*1 ans,upcase c write (*,*) 'Input a "y"' read (*,'((A))') ans write (*,*) ans,upcase(ans),(upcase(ans).EQ.'Y') c output is yY F ans=upcase(ans) write (*,*) ans,upcase(ans),(ans.EQ.'Y') c output is YY T stop end c c ---------------------------------------------------------------------- c FUNCTION UpCase (ch) c CHARACTER*1 UpCase,ch c IF ((ch.GE.'a').AND.(ch.LE.'z')) THEN UpCase=CHAR(ICHAR(ch)-ICHAR('a')+ICHAR('A')) ELSE UpCase=ch ENDIF RETURN END *** Number 2 *** program F77_Bug_6 c c ----- The first input works normally. However, the c second requires one to press twice before the input is accepted. c This worked properly with the compiler released with RISC(OS) 3.10, but c fails with the compiler released with RISC(OS) 4.30. The code is c compiled with the -vms option. c character*80 line c write (*,99) 'Input some text' read (*,99) line write (*,'(1x,(A),$)') 'Input more text: ' read (*,99) line write (*,99) 'Final output line' 99 format (1x,(A)) stop end The version of the compiler used is given by the following file (the stuff output when f77 -V is invoked). /usr/lib/cmplrs/f77/cpp: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/fcom: MIPS f77 2.0 (from RISC/os4.00 & cmplrs2.0) /usr/lib/cmplrs/f77/ujoin: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/uld: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/usplit: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/umerge: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/uopt: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/ugen: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/as0: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/as1: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/ld: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/ftoc: MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/cord: ldopen.c: 1.3 2/16/83 ldclose.c: 1.3 2/16/83 ldohseek.c: 1.1 1/7/82 ldshread.c: 1.1 1/7/82 ldsseek.c: 1.1 1/7/82 ldgetname.c: 1.2 2/16/83 ldtbread.c: 1.1 1/7/82 ldgetname.c: 1.2 2/16/83 ldrseek.c: 1.1 1/7/82 ldnrseek.c: 1.1 1/7/82 vldldptr.c: 1.1 1/8/82 allocldptr.c: 1.2 2/16/83 freeldptr.c: 1.1 1/7/82 ldnshread.c: 1.1 1/7/82 MIPS cmplrs 2.0 (from RISC/os 4.00) /usr/lib/cmplrs/f77/crt1.o: /usr/lib/cmplrs/f77/crtn.o: /usr/lib/cmplrs/f77/libm.a: pow.c 4.5 (Berkeley) 8/21/85 support.c 1.1 (Berkeley) 5/23/85 cbrt.c 1.1 (Berkeley) 5/23/85 log__L.c 1.2 (Berkeley) 8/21/85 log1p.c 1.3 (Berkeley) 8/21/85 exp__E.c 1.2 (Berkeley) 8/21/85 expm1.c 1.2 (Berkeley) 8/21/85 asinh.c 1.2 (Berkeley) 8/21/85 acosh.c 1.2 (Berkeley) 8/21/85 atanh.c 1.2 (Berkeley) 8/21/85 /usr/lib/cmplrs/f77/libF77.a: /usr/lib/cmplrs/f77/libI77.a: /usr/lib/cmplrs/f77/libU77.a: mkindx.c 1.1 mkvers.c 1.2 /usr/lib/cmplrs/f77/libisam.a: f77 (f77) Mips Computer Systems 2.0 ------- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | Arnold Gill | | | Queen's University at Kingston | If I hadn't wanted it heard, | | BITNET : gilla@qucdn | I wouldn't have said it. | | X-400 : Arnold.Gill@QueensU.CA | | | INTERNET : gilla@qucdn.queensu.ca | | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-