[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: g++ Bug? Why w/ and w/o "O3" options gives different result(g++3.3.3
From: |
Andre Poenitz |
Subject: |
Re: g++ Bug? Why w/ and w/o "O3" options gives different result(g++3.3.3) for this program? |
Date: |
Mon, 6 Dec 2004 10:22:33 +0100 |
Peng Yu <pengyu.ut@gmail.com> wrote:
> Is there any way to force the compiler to save or not to save it in
> the memory?
There is a -ffloat-store option that 'helps' sometimes.
However, the only sensible solution is to write code that does not
depend on floating point pecularities of any given compiler, any given
platform or any given phase of the moon.
I.e. never test for exact values. Round sensibly. Use stable algorithms.
This is non-trivial (and maybe not even possible) but save a lot of
hassle in the long run.
Andre'