This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Optimization and floating point


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]