]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR libfortran/15930 ([irix6.5] gfortran libraries not built)
authorRoger Sayle <roger@eyesopen.com>
Sun, 15 Aug 2004 01:27:43 +0000 (01:27 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 15 Aug 2004 01:27:43 +0000 (01:27 +0000)
Backport from mainline.
PR libgfortran/15930
* fixinc/inclhack.def (irix___generic1, irix___generic2): New.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/internal/math_core.h: New file

Co-Authored-By: David Billinghurst <David.Billinghurst@riotinto.com>
From-SVN: r86017

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def

index 2a64568f9cb493c9e9e7e39f0582dcff207fadee..cc9f6eb8a9287e577b164afb0fca91b59176e27f 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-14  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-08  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/16790
index c2d27b0414b5d496a95910812d77bec0091b987d..c9cbf3acbda374905308f41ce9fd40c3a4618396 100644 (file)
@@ -5,7 +5,7 @@
  * files which are fixed to work correctly with ANSI C and placed in a
  * directory that GNU C will search.
  *
- * This file contains 164 fixup descriptions.
+ * This file contains 166 fixup descriptions.
  *
  * See README for more information.
  *
@@ -2672,6 +2672,88 @@ static const char* apzIrix___RestrictPatch[] = {
 #  endif",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  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
@@ -6453,9 +6535,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          178
+#define REGEX_COUNT          180
 #define MACH_LIST_SIZE_LIMIT 334
-#define FIX_COUNT            164
+#define FIX_COUNT            166
 
 /*
  *  Enumerate the fixes
@@ -6526,6 +6608,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,
@@ -6953,6 +7037,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 959cb569da0b09ae720403f253c57f6ffc8b8149..534a0b419c43fc05598ce93e5c724c0e8361debe 100644 (file)
@@ -1549,6 +1549,52 @@ fix = {
     test_text = "#ifdef __c99\n#  define __restrict restrict";
 };
 
+/*
+ * 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