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]

[libgfortran] Minor tweak to support Compaq Tru64


The following very minor tweak fixes 1453 failures in the gfortran
testsuite on alphaev67-dec-osf5.1.  The problem is that Tru64 doesn't
provide "isinf" (at all, not just that it doesn't honor +Inf/-Inf
conventions).  The workaround below is to use the slightly more
portable "isnan".  At this point in the code, we've already checked
that the value isn't finite, and this test simply distinguishes NaNs
from Infs.

My apologies if we're now caught between a rock and a hard place, if
some platforms provide isnan but not isinf, and other isinf but not
isnan.  Its unlikely, but if so it's easier for gfortran to provide
an "isnan" replacement than it is to provide "isinf" functionality.


The following patch has been tested on both i686-pc-linux-gnu and
alphaev67-dec-osf5.1 with a full "make bootstrap", including fortran,
and regression tested with a top-level "make -k check" with no new
failures (and 1453 less failures on the alpha :).

Ok for mainline?  I can submit a follow-up patch to address the
inconsistent indentation in this function, if thats appropriate.



2004-07-25  Roger Sayle  <roger@eyesopen.com>

	* io/write.c (write_float): Use the slightly more portable isnan
	in preference to isinf.


Index: write.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 write.c
*** write.c	8 Jul 2004 19:58:56 -0000	1.8
--- write.c	25 Jul 2004 14:37:28 -0000
*************** write_float (fnode *f, const char *sourc
*** 523,529 ****
           }

           memset(p, ' ', nb);
!          res = isinf (n);
           if (res != 0)
           {
              if (signbit(n))
--- 523,529 ----
           }

           memset(p, ' ', nb);
!          res = !isnan (n);
           if (res != 0)
           {
              if (signbit(n))

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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