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]

[RFC] Fix IRIX 6.5 math.h header for PR fortran/15930


This patch to the IRIX 6.5 header internal/math_core.h (included by math.h) 
addresses PR fortran/15930, and also fixes some libstdc++ failures.  
Work is incomplete, as there are two new FAILs (below).  I just want some
feedback to ensure the fix is heading in the right direction.

Be gentle - it is my first foray into fixincludes.

With this fix:
 o libgfortran builds with -n32 and -64 ABIs
 o gfortran tests run with -n32 and -64 ABIs.  Results aren't too bad
 o one additional g++ failures
   +FAIL: g++.old-deja/g++.robertl/eb42.C (test for excess errors)
 o fix four libstdc++ fails but add a new one
   -FAIL: 22_locale/num_get/get/char/10.cc execution test
   -FAIL: 22_locale/num_get/get/wchar_t/10.cc execution test
   -FAIL: 26_numerics/c99_classification_macros_c++.cc (test for excess errors)
   -FAIL: 26_numerics/c99_classification_macros_c.cc (test for excess errors)
   +FAIL: 27_io/basic_ostream/inserters_arithmetic/char/4402.cc execution test
I cannot see an obvious cause for the two new FAILs (yet)


The header has lines like

#define fpclassify(x) __generic(x,,, _fpclassify, _fpclassifyf, _fpclassifyl,,,)(x)

which transform to

#define fpclassify(x) _fpclassify(x)
#define fpclassifyf(x) _fpclassifyf(x)
#define fpclassifyl(x) _fpclassifyl(x)


2004-06-22  David Billinghurst (David.Billinghurst@riotinto.com)

	* inclhack.def: Add irix___generic
	* fixincl.x: regenerate
	* tests/base/internal/math_core.h: New file

--- inclhack.def        2004/05/03 15:19:16     1.197
+++ inclhack.def        2004/06/22 00:25:49
@@ -1576,6 +1576,30 @@
 };
 
 /*
+ * IRIX 6.5.22 <internal/math_core.h> uses the SGI c99 __generic() macro
+ * to define the fpclasify, isinfinite, isinf, isnan, isnormal and signbit 
+ * functions.
+ *
+ * This was probably introduced around IRIX 6.5.18
+ */
+fix = {
+    hackname  = irix___generic;
+    files     = internal/math_core.h;
+    mach      = "mips-sgi-irix6.5";
+    select    = "#define ([a-z]+)(\\([x,y]+\\)) *__generic.*";
+
+    c_fix     = format;
+    c_fix_arg = "#define %1%2 _%1%2\n"
+                "#define %1f%2 _%1f%2\n"
+                "#define %1l%2 _%1l%2";
+
+    test_text = 
+      "#define isnan(x) __generic(x,,, _isnan, _isnanf, _isnanl,,,)(x)\n"
+      "#define isless(x,y)         __generic(x,y,, _isless, _islessf, _islessl,,,)(x,y)";
+};
+
+
+/*
  *  IRIX 5.2's <sys/asm.h> contains an asm comment with a contraction
  *  that causes the assembly preprocessor to complain about an
  *  unterminated character constant.


--- /dev/null   Tue Jun 22 10:29:54 2004
+++ tests/base/internal/math_core.h     Mon Jun 21 16:06:05 2004
@@ -0,0 +1,19 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+       "fixinc/tests/inc/internal/math_core.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( IRIX___GENERIC_CHECK )
+#define isnan(x) _isnan(x)
+#define isnanf(x) _isnanf(x)
+#define isnanl(x) _isnanl(x)
+#define isless(x,y) _isless(x,y)
+#define islessf(x,y) _islessf(x,y)
+#define islessl(x,y) _islessl(x,y)
+#endif  /* IRIX___GENERIC_CHECK */


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