Subject: Re: beta 20.1 and 19 and 18 'rint' function with gcc is broken
From: [email-masked] (Mumit Khan)

15 Dec 1998 23:06:45 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: Jeff Deifik <[email-masked]>
Cc: [email-masked]

Jeff Deifik <[email-masked]> writes:
> I have reported a bug with the math function rint.
> It is still not fixed with the latest beta-20.1

Hi Jeff,

I did take a look when you posted the test case the first time around, 
and I apologize for forgetting all about it.

The problem is the way rint is written in newlib -- it's using the old 
Sun code that I'm not too fond of. In fact, most of newlib's math functions
are not up to par if you're going to develop numerical code on ix86.

The simple fix, albeit awkward, is to declare the variable "w" volatile in
newlib/libm/math/s_rint.c and then the compiler wouldn't optimize away the
critical section at the end. Another quick fix is to use a an assembly
version of rint (see glibc2 sources) and use that for cygwin.

The real fix is to dump the math library and use one of the better tested
ones. Even glibc2 does quite a bit better than newlib as long as you steer
clear of some of the buggy inlined routines.

The *real* fix IMO is to dump newlib, but that's a whole different topic.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".