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] Tweak gcc.dg/single-precision-constant.c for IRIX


The test case gcc.dg/single-precision-constant.c appears to be failing
on many platforms due to its use of the C99 "isinf" function/macro.
The patch below fixes this failure on systems like MIPS/IRIX where
-std=gnu99 is needed to obtain the appropriate macro definitions.
Unfortunately, something different is required for Solaris and Tru64
whose <math.h> don't define/declare "isinf".

Perhaps this code should be rewritten and placed in the ieee directory
as it relies on properties of IEEE floating point?

In the mean-time, the patch below fixes this testsuite failure on
mips-sgi-irix6.5.  Ok for mainline?



2006-02-09  Roger Sayle  <roger@eyesopen.com>

	* gcc.dg/single-precision-constant.c: Compile with -std=gnu99
	to obtain declaration of ISO C99's isinf on some platforms.


Index: single-precision-constant.c
===================================================================
*** single-precision-constant.c	(revision 110762)
--- single-precision-constant.c	(working copy)
***************
*** 1,8 ****
  /* Test that double precision constants are correctly handled
     when code is compiled with -fsingle-precision-constant */
  /* Origin: Carlos O'Donell <carlos@codesourcery.com> */
  /* { dg-do run } */
! /* { dg-options "-fsingle-precision-constant" } */
  #include <math.h>
  #include <float.h>

--- 1,10 ----
  /* Test that double precision constants are correctly handled
     when code is compiled with -fsingle-precision-constant */
+ /* The -std=gnu99 is needed to get isinf from <math.h> on some
+    platforms, including mips-sgi-irix6.5.  */
  /* Origin: Carlos O'Donell <carlos@codesourcery.com> */
  /* { dg-do run } */
! /* { dg-options "-std=gnu99 -fsingle-precision-constant" } */
  #include <math.h>
  #include <float.h>


Roger
--


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