This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cygwin-b20 gcc: "A - floor(A)" returns a negative value


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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]