delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/12/13:03:12

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: cygwin-b20 gcc: "A - floor(A)" returns a negative value
12 Nov 1998 13:03:12 -0800 :
Message-ID: <Pine.SUN.3.93.981111145940.18685C-100000.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <19981110143045 DOT 1359 DOT rocketmail AT send101 DOT yahoomail DOT com>
Mime-Version: 1.0
To: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Cc: Peter Kabal <Kabal AT ece DOT mcgill DOT ca>, gnu-win32 AT cygnus DOT com

On Tue, 10 Nov 1998, Earnie Boyd wrote:

> Hi Peter,
> 
> Although your example indeed shows a potential bug in the optimizer
> IMHO your example is a little buggy itself.  I believe your intent
> with the printf is to show the values that gave you the result and to
> do this you need two variables.  When I modified your example to use
> two variables, AV1 and AV2, the result was the same for all values of
> optimization.

Peter's example is correct and legal. It's the problem with how GCC deals
with the excess precision in x86 FP.

For a discussion about this in egcs list, follow the thread starting at:
  
  http://www.cygnus.com/ml/egcs-bugs/1998-Nov/0269.html

It is not a cygwin/mingw specific issue (problem?), but rather on all
x86 GCC ports.

One solution suggested, and used heavily by f77 users on Linux, is to
muck with fp control words at startup. I might add something similar
as a link time option to egcs on win32 if it seems reasonable to do 
so.

Regards,
Mumit


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019