This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c99-math execute failures on sparc-sun-solaris2.11


Kaveh R. Ghazi wrote:

Okay, thanks both of you for tracking this down.

So the solaris definition of isinf is not exception-safe in the presence of nans. Try inserting this code into c99-math-double-1.c after it includes math headers. (This is what fixincludes puts into the header for solaris 10). See if it helps:

#undef isinf
#define isinf(x) __extension__ ({ const __typeof (x) __x_i = (x); \
__builtin_expect(sizeof(__x_i) == sizeof(float) \
 ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \
   : sizeof(__x_i) == sizeof(long double) \
   ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__) \
     : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0); })

It may pass isinf, but fail on a later if-abort. But hopefully this is the only broken bit in that header on solaris.

[ultra10:gcc/gcc/testsuite] andreast% svn diff gcc.dg/c99-math-double-1.c Index: gcc.dg/c99-math-double-1.c =================================================================== --- gcc.dg/c99-math-double-1.c (revision 132096) +++ gcc.dg/c99-math-double-1.c (working copy) @@ -3,6 +3,13 @@

 #include <math.h>
 #include "c99-math.h"
+#undef isinf
+#define isinf(x) __extension__ ({ const __typeof (x) __x_i = (x); \
+__builtin_expect(sizeof(__x_i) == sizeof(float) \
+ ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \
+   : sizeof(__x_i) == sizeof(long double) \
+   ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__) \
+     : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0); })

 int main(void)
 {

The test does complete w/o abort.

Also the other two tests complete (applied the above on them too).

gmake RUNTESTFLAGS='dg.exp=c99-math-*' check

=== gcc Summary ===

# of expected passes 6


Thanks, Andreas


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