On 2/16/07, Andrew Makhorin wrote:
Nevertheless, you agree that if t0 > t1 then t0 - t1 cannot be exact zero in *any* floating-point model, don't you? Even if optimization is used, the compiler must not arbitrarily change the precision of the same floating-point variable.
The -ffloat-store compiler option is available for those programs who are concerned with such details. This is your code compiled -O2 and -f{no-,}float-store. The difference is one extra load instruction. $ diff -u f-floatstore.s f-nofloatstore.s --- f-floatstore.s 2007-02-16 04:26:19.117875000 -0500 +++ f-nofloatstore.s 2007-02-16 04:26:03.399125000 -0500 @@ -321,11 +321,10 @@ fxch %st(1) .stabn 68,0,12,LM12-_main LM12: - fstpl -16(%ebp) + fstl -16(%ebp) + fxch %st(1) .stabn 68,0,13,LM13-_main LM13: - fldl -16(%ebp) - fxch %st(1) fucompp fnstsw %ax sahf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/