This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] i386 mathinline.h breakage


Hi!

Compiling code with sinh/tanh fails with -O2 and without -ffast-math.
The reason is that __expm1* inline is only defined for -ffast-math, but
sinh/tanh which use it  are defined always if -O2.
I'm not sure what's right, either:
a) put in patch below
b) put __expm1* into math/Versions
c) conditionally define sinh/tanh to use either __exp1m* or exp1m* depending
   on -ffast-math

In any case, some more checking of all the inline math expanders with all of
-O0, -O2, -O2 -ffast-math would not hurt.

2000-06-04  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/i386/fpu/bits/mathinline.h: Only inline sinh, cosh and tanh
	if -ffast-math.

--- libc/sysdeps/i386/fpu/bits/mathinline.h.jj	Sun Jun  4 06:33:45 2000
+++ libc/sysdeps/i386/fpu/bits/mathinline.h	Sun Jun  4 06:35:52 2000
@@ -515,6 +515,8 @@ __inline_mathcode_ (long double, __sgn1l
   return __n.__xld)
 
 
+#ifdef __FAST_MATH__
+
 /* The argument range of the inline version of sinhl is slightly reduced.  */
 __inline_mathcodeNP (sinh, __x, \
   register long double __exm1 = __expm1l (__fabsl (__x));		      \
@@ -528,6 +530,7 @@ __inline_mathcodeNP (tanh, __x, \
   register long double __exm1 = __expm1l (-__fabsl (__x + __x));	      \
   return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
 
+#endif
 
 __inline_mathcodeNP (floor, __x, \
   register long double __value;						      \


	Jakub

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