This is the mail archive of the gcc-patches@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]

PATCH: Fix many 64-bit Solaris 11/x86 libgfortran testsuite failures


Many 64-bit libgfortran testcases failed on Solaris 11/x86, e.g.

FAIL: gfortran.dg/complex_write.f90 execution test

The test aborts in line 14, where r1 = -1.0 and r2 = -2.0, i.e. the
signs are wrong.  Running it under truss reveals that this alreay wrong
when writing.

After some debugging, I found that the sign_bit in io/write_float.def
(WRITE_FLOAT) is set incorrectly.  At first, I supposed that the signbit
definition in <iso/math_c99.h> were at fault, but so far I've been
unable to find any.

It turned out that invoking __builtin_signbit fixes the problem; since
there are many cases where libgfortran uses GCC builtins directly, I
cannot imagine that this should cause other problems.

With that change, 64-bit libgfortran testsuite results are massively
improved: the only remaining failures are the spurious stat_[12].f90
failures already reported in PR fortran/42900, and some LTO failures to
be investigated separately.

Ok for mainline?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2010-02-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* io/write_float.def (WRITE_FLOAT): Use __builtin_signbit.

diff -r d08c7dd52cb0 -r 8e8f412c4db0 libgfortran/io/write_float.def
--- a/libgfortran/io/write_float.def	Fri Feb 12 12:27:04 2010 +0100
+++ b/libgfortran/io/write_float.def	Fri Feb 12 15:03:56 2010 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Andy Vaught
    Write float code factoring to this file by Jerry DeLisle   
    F2003 I/O support contributed by Jerry DeLisle
@@ -818,7 +818,7 @@
 {\
 	GFC_REAL_ ## x tmp;\
 	tmp = * (GFC_REAL_ ## x *)source;\
-	sign_bit = signbit (tmp);\
+	sign_bit = __builtin_signbit (tmp);\
 	if (!isfinite (tmp))\
 	  { \
 	    write_infnan (dtp, f, isnan (tmp), sign_bit);\


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