X-Spam-Check-By: sourceware.org Message-ID: Date: Fri, 16 Feb 2007 09:38:29 -0500 From: "Lev Bishop" To: "Andrew Makhorin" , cygwin AT cygwin DOT com Subject: Re: strange bug in gettimeofday function In-Reply-To: <1433795387.20070216163624@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13811889795 DOT 20070215071733 AT gnu DOT org> <106982500 DOT 20070216041231 AT gnu DOT org> <1433795387 DOT 20070216163624 AT gnu DOT org> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/