This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Optimization and floating point
- To: gcc-help at gcc dot gnu dot org
- Subject: Optimization and floating point
- From: Tony_LELIEVRE at pechiney dot com
- Date: Thu, 22 Mar 2001 17:23:38 +0100
I use a finite element code written in C++ and I want to compile it on a pentium III processor (I am using Cygwin under NT). The problem is that when I optimize the compilation (just with -O), one of
the calculus give an infinite result (NaN). I do not think it is a problem of my code since I've used it for one year on SGI and it was OK.
In order to try to understand the problem, I have tested the little program paranoia.c (cf. http://www.netlib.org/paranoia/) and it turns out that a lot of problems appear when I compile with -O, but
the result is good when I compile without optimization. I have also tried the Watcom compiler, and it gives good results...
How can I obtain good result with GNU gcc ? What optimization should I turn off ?
Thanks a lot,
Tony LELIEVRE.