floating point precision with -O2 optimization

John (Eljay) Love-Jensen eljay@adobe.com
Mon Jan 4 14:47:00 GMT 2010


Hi Frederic,

> So first my question is: is it normal to have different numerical computation
in O2 vs O0 ?

The short answer is:
yes, it is normal to have different floating-point numerical computation in
O2 vs O0.  There are GCC switches to produce consistent results, at the cost
of performance.

The long answer is:
http://docs.sun.com/source/806-3568/ncg_goldberg.html

HTH,
--Eljay



More information about the Gcc-help mailing list