OSDN Git Service

PR libgfortran/15930
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Aug 2004 21:13:56 +0000 (21:13 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Aug 2004 21:13:56 +0000 (21:13 +0000)
* fixinc/inclhack.def (irix___generic1, irix___generic2): New.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/internal/math_core.h: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85962 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/internal/math_core.h [new file with mode: 0644]

index dc11692..610345d 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-13  Roger Sayle  <roger@eyesopen.com>
+           David Billinghurst  <David.Billinghurst@riotinto.com>
+
+       PR libgfortran/15930
+       * fixinc/inclhack.def (irix___generic1, irix___generic2): New.
+       * fixinc/fixincl.x: Regenerate.
+       * fixinc/tests/base/internal/math_core.h: New file.
+
 2004-08-13  Richard Henderson  <rth@redhat.com>
 
        * dbxout.c (NO_DBX_FUNCTION_END): Default to zero.
index a1b650e..b8a2342 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Monday May  3, 2004 at 05:17:48 PM MEST
+ * It has been AutoGen-ed  Thursday August 12, 2004 at 05:42:28 PM MDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Mon May  3 17:17:49 MEST 2004
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Aug 12 17:42:28 MDT 2004
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 175 fixup descriptions.
+ * This file contains 177 fixup descriptions.
  *
  * See README for more information.
  *
@@ -2830,6 +2830,88 @@ static const char* apzIrix___RestrictPatch[] = {
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Irix___Generic1 fix
+ */
+tSCC zIrix___Generic1Name[] =
+     "irix___generic1";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zIrix___Generic1List[] =
+  "|internal/math_core.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzIrix___Generic1Machs[] = {
+        "mips-sgi-irix6.5",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zIrix___Generic1Select0[] =
+       "#define ([a-z]+)\\(x\\) *__generic.*";
+
+#define    IRIX___GENERIC1_TEST_CT  1
+static tTestDesc aIrix___Generic1Tests[] = {
+  { TT_EGREP,    zIrix___Generic1Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Irix___Generic1
+ */
+static const char* apzIrix___Generic1Patch[] = {
+    "format",
+    "extern int %1(double);\n\
+extern int %1f(float);\n\
+extern int %1l(long double);\n\
+#define %1(x) (sizeof(x) == sizeof(double) ? _%1(x) \\\n\
+               : sizeof(x) == sizeof(float) ? _%1f(x) \\\n\
+               : _%1l(x))\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Irix___Generic2 fix
+ */
+tSCC zIrix___Generic2Name[] =
+     "irix___generic2";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zIrix___Generic2List[] =
+  "|internal/math_core.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzIrix___Generic2Machs[] = {
+        "mips-sgi-irix6.5",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zIrix___Generic2Select0[] =
+       "#define ([a-z]+)\\(x,y\\) *__generic.*";
+
+#define    IRIX___GENERIC2_TEST_CT  1
+static tTestDesc aIrix___Generic2Tests[] = {
+  { TT_EGREP,    zIrix___Generic2Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Irix___Generic2
+ */
+static const char* apzIrix___Generic2Patch[] = {
+    "format",
+    "#define %1(x,y) \\\n\
+  ((sizeof(x)<=4 && sizeof(y)<=4) ? _%1f(x,y) \\\n\
+   : (sizeof(x)<=8 && sizeof(y)<=8) ? _%1(x,y) \\\n\
+   : _%1l(x,y))\n",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Irix_Asm_Apostrophe fix
  */
 tSCC zIrix_Asm_ApostropheName[] =
@@ -6936,9 +7018,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          197
+#define REGEX_COUNT          199
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            175
+#define FIX_COUNT            177
 
 /*
  *  Enumerate the fixes
@@ -7012,6 +7094,8 @@ typedef enum {
     IO_QUOTES_USE_FIXIDX,
     IP_MISSING_SEMI_FIXIDX,
     IRIX___RESTRICT_FIXIDX,
+    IRIX___GENERIC1_FIXIDX,
+    IRIX___GENERIC2_FIXIDX,
     IRIX_ASM_APOSTROPHE_FIXIDX,
     IRIX_LIMITS_CONST_FIXIDX,
     IRIX_SOCKLEN_T_FIXIDX,
@@ -7462,6 +7546,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      IRIX___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aIrix___RestrictTests,   apzIrix___RestrictPatch, 0 },
 
+  {  zIrix___Generic1Name,    zIrix___Generic1List,
+     apzIrix___Generic1Machs,
+     IRIX___GENERIC1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aIrix___Generic1Tests,   apzIrix___Generic1Patch, 0 },
+
+  {  zIrix___Generic2Name,    zIrix___Generic2List,
+     apzIrix___Generic2Machs,
+     IRIX___GENERIC2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aIrix___Generic2Tests,   apzIrix___Generic2Patch, 0 },
+
   {  zIrix_Asm_ApostropheName,    zIrix_Asm_ApostropheList,
      apzIrix_Asm_ApostropheMachs,
      IRIX_ASM_APOSTROPHE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index aa26ff7..62ad4d5 100644 (file)
@@ -1576,6 +1576,52 @@ fix = {
 };
 
 /*
+ * IRIX 6.5.22 <internal/math_core.h> uses the SGI c99 __generic() intrinsic
+ * to define the fpclasify, isfinite, isinf, isnan, isnormal and signbit 
+ * functions.
+ *
+ * This was probably introduced around IRIX 6.5.18
+ */
+fix = {
+    hackname  = irix___generic1;
+    files     = internal/math_core.h;
+    mach      = "mips-sgi-irix6.5";
+    select    = "#define ([a-z]+)\\(x\\) *__generic.*";
+
+    c_fix     = format;
+    c_fix_arg = "extern int %1(double);\n"
+               "extern int %1f(float);\n"
+               "extern int %1l(long double);\n"
+               "#define %1(x) (sizeof(x) == sizeof(double) ? _%1(x) \\\n"
+               "               : sizeof(x) == sizeof(float) ? _%1f(x) \\\n"
+               "               : _%1l(x))\n";
+
+    test_text = 
+      "#define isnan(x) __generic(x,,, _isnan, _isnanf, _isnanl,,,)(x)\n";
+};
+
+
+/* Likewise <internal/math_core.h> on IRIX 6.5.19 and later uses the SGI
+   compiler's __generic intrinsic to define isgreater, isgreaterequal,
+   isless, islessequal, islessgreater and isunordered functions.  */
+fix = {
+    hackname  = irix___generic2;
+    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(x,y) \\\n"
+               "  ((sizeof(x)<=4 && sizeof(y)<=4) ? _%1f(x,y) \\\n"
+               "   : (sizeof(x)<=8 && sizeof(y)<=8) ? _%1(x,y) \\\n"
+               "   : _%1l(x,y))\n";
+
+    test_text = 
+      "#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.
diff --git a/gcc/fixinc/tests/base/internal/math_core.h b/gcc/fixinc/tests/base/internal/math_core.h
new file mode 100644 (file)
index 0000000..f39ac3f
--- /dev/null
@@ -0,0 +1,30 @@
+/*  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___GENERIC1_CHECK )
+extern int isnan(double);
+extern int isnanf(float);
+extern int isnanl(long double);
+#define isnan(x) (sizeof(x) == sizeof(double) ? _isnan(x) \
+               : sizeof(x) == sizeof(float) ? _isnanf(x) \
+               : _isnanl(x))
+
+
+#endif  /* IRIX___GENERIC1_CHECK */
+
+
+#if defined( IRIX___GENERIC2_CHECK )
+#define isless(x,y) \
+  ((sizeof(x)<=4 && sizeof(y)<=4) ? _islessf(x,y) \
+   : (sizeof(x)<=8 && sizeof(y)<=8) ? _isless(x,y) \
+   : _islessl(x,y))
+
+#endif  /* IRIX___GENERIC2_CHECK */