g77 bug

Matthew Bettencourt matt@mail.ssc.usm.edu
Thu Feb 15 14:40:00 GMT 2001


I have a very simple code (part of linpack) that seems to show a bug in
g77.  Now, if I compile this just like

g77 main.f -O
I get the right results

However, if I compile as follows

g77 main.f

I get the wrong results.

Any ideas??

      DOUBLE PRECISION EPS,HUGE,S,TINY
C     ..
      EPS = 1.0D0
   10 EPS = EPS/2.0D0
      S = 1.0D0 + EPS
      IF (S.GT.1.0D0) GO TO 10
      EPS = 2.0D0*EPS

      print*,eps

      stop
      end


Here is my g77 info

{attica} 174 % g77 -v
g77 version pgcc-2.95.2 19991024 (release) (from FSF-g77 version 0.5.25
19991024 (release))
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from
/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/specs
gcc version pgcc-2.95.2 19991024 (release)
 /home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/cpp -lang-c
-v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -D__unix__ -D__i386__
-D__linux__ -D__unix -D__linux -Asystem(posix) -D_LANGUAGE_FORTRAN
-traditional -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__
/dev/null /dev/null
GNU CPP version pgcc-2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /home/matt/pgcc/include

/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/../../../../i686-pc-linux-gnu/include
 /home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search
path:

/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/../../../../include/g++-3
End of omitted list.
 /home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/f771
-fnull-version -quiet -dumpbase g77-version.f -version -fversion -o
/tmp/ccWq09uP.s /dev/null
GNU F77 version pgcc-2.95.2 19991024 (release) (i686-pc-linux-gnu)
compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2
release).
GNU Fortran Front End version 0.5.25 19991024 (release)
 as -V -Qy -o /tmp/ccUHJtjw.o /tmp/ccWq09uP.s
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version
2.9.5.0.22
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/cc4QFpAc
/tmp/ccUHJtjw.o /usr/lib/crt1.o /usr/lib/crti.o
/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/crtbegin.o
-L/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2
-L/home/matt/pgcc/lib -lg2c -lm -lgcc -lc -lgcc
/home/matt/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/crtend.o
/usr/lib/crtn.o
 /tmp/cc4QFpAc
__G77_LIBF77_VERSION__: 0.5.25 19991024 (release)
@(#)LIBF77 VERSION 19990503
__G77_LIBI77_VERSION__: 0.5.25 19991024 (release)
@(#) LIBI77 VERSION pjw,dmg-mods 19990503
__G77_LIBU77_VERSION__: 0.5.25 19991024 (release)
@(#) LIBU77 VERSION 19980709

Thanks
Matt
{attica} 175 % g77 main.f -O
{attica} 176 % a.out
  1.08420217E-19
{attica} 177 % g77 main.f 
{attica} 178 % a.out
  2.22044605E-16
{attica} 179 % pgf77 main.f
{attica} 180 % a.out
   1.0842021724855044E-019
FORTRAN STOP



More information about the Gcc-bugs mailing list