[PATCH] Fix i386 bits/mathinline.h with -ansi -pedantic
Jakub Jelinek
jakub@redhat.com
Mon May 22 10:08:00 GMT 2000
On Mon, May 22, 2000 at 07:30:14AM -0700, Ulrich Drepper wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
>
> > +++ libc/sysdeps/i386/fpu/bits/mathinline.h Mon May 22 16:28:00 2000
> > @@ -367,7 +367,8 @@ __sincosl (long double __x, long double
> > ("fscale # 2^int(x * log2(e))\n\t" \
> > : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \
> > __temp -= 1.0; \
> > - return __temp + __value ?: __x
> > + __temp += __value; \
> > + return __temp ? __temp : __x
> > __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
>
> Your change is not preserving the semantics. Once you corrected this
> make sure the generated code is the same. There is no reason at all
> to make the generated worse code.
How does it change semantics?
#include <math.h>
long double a, b, c;
void foo(void)
{
a = __expm1l(b);
}
generates identical output with -O2 with unpatched and patched
bits/mathinline.h (and similarly with -O2 -ansi -pedantic, though the output
is different from plain -O2).
Jakub
More information about the Libc-hacker
mailing list