This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: FP consistency and -O2


>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).

-- 
Peter Barada
peter@the-baradas.com


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