public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFC] Fix IRIX 6.5 math.h header for PR fortran/15930
@ 2004-06-22  4:55 Billinghurst, David (CALCRTS)
  2004-07-11 11:08 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: Billinghurst, David (CALCRTS) @ 2004-06-22  4:55 UTC (permalink / raw)
  To: gcc-patches

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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] Fix IRIX 6.5 math.h header for PR fortran/15930
  2004-06-22  4:55 [RFC] Fix IRIX 6.5 math.h header for PR fortran/15930 Billinghurst, David (CALCRTS)
@ 2004-07-11 11:08 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2004-07-11 11:08 UTC (permalink / raw)
  To: Billinghurst, David (CALCRTS); +Cc: gcc-patches

"Billinghurst, David (CALCRTS)" <david.billinghurst@comalco.riotinto.com.au> writes:
> 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.

Feeling guilty that no-one's replied to this yet.  FWIW, I don't feel
qualified to offer an opinion since our (much older) release of IRIX
doesn't have these definitions.  I also have no idea about fixincludes
stuff.

Richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-11  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-22  4:55 [RFC] Fix IRIX 6.5 math.h header for PR fortran/15930 Billinghurst, David (CALCRTS)
2004-07-11 11:08 ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).