Message-Id: <200001261144.GAA13758@LONG-MARCH.MIT.EDU> To: pgcc AT delorie DOT com Cc: liju99 AT MIT DOT EDU Subject: pgcc 2.95.3 "-O6 -ffast-math" bug Date: Wed, 26 Jan 2000 06:44:49 EST From: Ju Li Reply-To: pgcc AT delorie DOT com Hello, I have used pgcc extensively for 2 months. First of all let me say that pgcc is very, very good. Thanks. The bug is pinned down as follows, /* bug.c */ #include void a (double x) { printf ("x = %f\n", x); if (x == 0.0) printf ("bug: x == 0\n"); return; } int main (int argc, char *argv[]) { a (2.0); return(0); } Using pgcc binaries downloaded from http://www.goof.com/pcg/binaries-linux.html, I get % /usr/local/pgcc/bin/gcc -O6 -ffast-math bug.c -o bug; ./bug x = 2.000000 bug: x == 0 As sanity check I use egcs to compile it, % rpm -qf /usr/bin/gcc egcs-1.1.2-24 % /usr/bin/gcc -O6 -ffast-math bug.c -o bug; ./bug x = 2.000000 Since I get different results using egcs and pgcc on the same machine using identical flags, it means pgcc has a bug. I don't know if this bug happens on other machines beside my PII RedHat 5.2. For details, % /usr/local/pgcc/bin/gcc -v --save-temps -O6 -ffast-math bug.c -o bug Reading specs from /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/spe cs gcc version pgcc-2.95.2 19991024 (release) /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/cpp -lang-c -v -D__GN UC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__uni x__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__OPTIMIZE__ -D_ _FAST_MATH__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpen tiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ bug.c bug.i GNU CPP version pgcc-2.95.2 19991024 (release) (i386 Linux/ELF) #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/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: /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/../../../../include/g ++-3 /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/../../../../i686-pc-l inux-gnu/include End of omitted list. /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/cc1 bug.i -mno-ieee-f p -quiet -dumpbase bug.c -O6 -version -ffast-math -o bug.s GNU C version pgcc-2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version pgcc-2.95.2 19991024 (release). as -V -Qy -o bug.o bug.s GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version 2.9.1.0.24 /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o bug /usr/lib/crt1.o /usr/lib/crti.o /usr/l ocal/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/crtbegin.o -L/usr/local/pgcc /lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2 -L/usr/local/pgcc/lib bug.o -lgcc -lc -lgcc /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/crtend.o /usr/l ib/crtn.o Best regards, Li Ju.