Overview Description: More detailed expansion of summary. Drag-selecting any page crashes Mac builds in NSGetFactory Steps to Reproduce: Compile and run Actual Results: Program's output: shouldn't be here ok! ok! Expected Results: ok! ok! ok! Build Date & Platform: [lee@yavin strange]$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Additional Builds and Platforms: On sparc-sun-solaris2.6 the output is also not as expected but not the same as on Linux: Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs gcc version 2.95.2 19991024 (release) Program's output: ok! shouldn't be here ok! The following is the *.i file: # 1 "exp.c" # 1 "<built-in>" # 1 "<command line>" # 1 "exp.c" int printf(const char *format, ...); double two = 2; double five = 5; const double f() { return five; } int main () { # 21 "exp.c" if(two/f() == two/f()) { printf("ok!\n"); } else { printf("shouldn't be here\n"); } if((long double)two/f() == two/f()){ printf("ok!\n"); } else { printf("shouldn't be here\n"); } if(two/five == two/five){ printf("ok!\n"); } else { printf("shouldn't be here\n"); } return 0; }
Created attachment 4602 [details] Preprocessed source code exp.i
Though often reported this is not a bug. See the section titled "Problems with floating point computations." on http://gcc.gnu.org/bugs.html. *** This bug has been marked as a duplicate of 323 ***