This is the mail archive of the
mailing list for the GCC project.
Re: FP consistency and -O2
- From: Peter Barada <peter at the-baradas dot com>
- To: gcc at stuartreynoldsDOTnet dot baradas dot org
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 6 Jan 2004 16:48:33 -0500 (EST)
- Subject: Re: FP consistency and -O2
- References: <3FFB1480.9080901@stuartreynoldsDOTnet>
>I'm having issues with the optimisation options. I get different
>floating point calculations depending on whether -O is set or not.
>Is this a bug? It's certainly causing bugs for me.
>If its not a bug, does anyone know if there a way of turning off all
>optimisations that change program semantics?
You may be getting bit by the result being held in the FPU
which is 80 bits instead of the 32 bit float which would be on the stack.
You could try -ffloat-store to tell the compiler to store FP values
in memory instead of the FPU which will force rounding to the
precision(in this case a float).