Subject: Re: cygwin-b20 gcc: "A - floor(A)" returns a negative value
From: [email-masked] (Mumit Khan)

12 Nov 1998 13:03:12 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: Earnie Boyd <[email-masked]>
Cc: Peter Kabal <[email-masked]>, [email-masked]

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
"[email-masked]" with one line of text: "help".