This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
floating point: weird behaviour of gcc-2.95
- From: juggy at gmx dot net
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jan 2003 12:29:37 +0100
- Subject: floating point: weird behaviour of gcc-2.95
Hi there,
I recently noticed an odd behaviour of gcc. I searched the archives, but
I didn't find anything that really looks like this.
I am currently writing software that must be as numerically stable as
possible. Now the problem is that on Linux-Machines with gcc-2.95.3 and
gcc-2.95.4 (I didn't have other versions to check) using the switch -O2
results in inaccuracies (i.e. a double variable never becomes 0) whilst
-O1 is still alright.
At first I thought I might be using the switches in a wrong way, but
when I checked on a FreeBSD system (gcc-2.95.3) with the exactly same
program and the same switches it worked fine. I also tried switches like
-fno-fast-math and such, but none seemed to solve the problem.
Afterwards I checked with gcc-3.2.1, and everything worked fine with -O2.
Maybe I am missing something about using the correct switches, but I
think it is very odd that gcc on BSD and gcc on Linux show this
different a behaviour. I'd really appreciate if anyone could elighten me
on this issue.
Thanks in advance