Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!PRINCETON.EDU!ney From: ney@PRINCETON.EDU (Neal Young) Newsgroups: gnu.gcc.bug Subject: gcc bug Message-ID: <8905292137.AA23435@notecnirp.Princeton.EDU> Date: 29 May 89 21:37:03 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36 I think I've run across a gcc bug involving floating point constants. Here is a .c file and a shell session demonstrating the bug. (I'm running on a fairly large vax...) tmp.c ------------------------------------------------------------- main() { float i; i = 1.0; printf("%g is %s greater than zero\n", i, i > 0.0 ? "" : "not" ); } ------------------------------------------------------------- Shell session: ------------------------------------------------------------- notecnirp> gcc -v -o tmp tmp.c gcc version 1.35 /usr/local/gnu/lib/gcc-cpp -v -undef -D__GNUC__ -Dvax -Dunix -D__vax__ -D__unix__ tmp.c /tmp/cc023377.cpp GNU CPP version 1.35 /usr/local/gnu/lib/gcc-cc1 /tmp/cc023377.cpp -quiet -dumpbase tmp.c -version -o /tmp/cc023377.s GNU C version 1.35 (vax) compiled by GNU C version 1.35. tmp.c: In function main: tmp.c:4: magnitude of constant too large for `float' notecnirp> ---------------------------------------------------------------- I've also had problems with "gas" involving floating points. In particular, the above program on one of our Suns compiles but the assignment "i = 1.0" sets i to zero, so the program outputs "0 is not greater than zero". I documented this form of the problem, which seemed to be an assembler bug from examining the code produced etc. and sent it to hack@gnu.ai.mit.edu. Neal Young (ney@notecnirp.princeton.edu)