]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
inclhack.def (solaris_math_10): New.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Thu, 13 Mar 2008 21:28:10 +0000 (21:28 +0000)
committerAndreas Tobler <andreast@gcc.gnu.org>
Thu, 13 Mar 2008 21:28:10 +0000 (22:28 +0100)
2008-03-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
    Andreas Tobler  <a.tobler@schweiz.org>

* inclhack.def (solaris_math_10): New.
* tests/base/iso/math_c99.h: Update.
* fixincl.x: Regenerate.

Co-Authored-By: Andreas Tobler <a.tobler@schweiz.org>
From-SVN: r133196

fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def
fixincludes/tests/base/iso/math_c99.h

index 3e94a26905498b58c5c0dff11ffaac0818da153d..fed938f562cea352995a88d2dcff56ec3dee548c 100644 (file)
@@ -1,3 +1,10 @@
+2008-03-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+           Andreas Tobler  <a.tobler@schweiz.org>
+
+       * inclhack.def (solaris_math_10): New.
+       * tests/base/iso/math_c99.h: Update.
+       * fixincl.x: Regenerate.
+
 2008-02-04  Ismail Dönmez  <ismail@pardus.org.tr>
 
        * inclhack.def: (bsd_stdio_attrs_conflict, freebsd_gcc3_breakage,
index 56bdaa8f450d08258ac15de75eabf1ce955b1309..7c422baa7c66f4992b2c61b9ee3496dde9223d18 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Sunday February 10, 2008 at 10:38:20 PM GMTST
+ * It has been AutoGen-ed  Thursday February 21, 2008 at 09:53:39 PM CET
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Sun Feb 10 22:38:21 GMTST 2008
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Feb 21 21:53:39 CET 2008
  *
  * 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 204 fixup descriptions.
+ * This file contains 205 fixup descriptions.
  *
  * See README for more information.
  *
@@ -5619,6 +5619,52 @@ static const char* apzSolaris_Math_9Patch[] = {
     "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) __builtin_[a-z]+\\(y\\)\\)",
     (char*)NULL };
 
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *  Description of Solaris_Math_10 fix
+ */
+tSCC zSolaris_Math_10Name[] =
+     "solaris_math_10";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_Math_10List[] =
+  "|iso/math_c99.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzSolaris_Math_10Machs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Math_10Select0[] =
+       "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define    SOLARIS_MATH_10_TEST_CT  1
+static tTestDesc aSolaris_Math_10Tests[] = {
+  { TT_EGREP,    zSolaris_Math_10Select0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Math_10
+ */
+static const char* apzSolaris_Math_10Patch[] = {
+    "format",
+    "#define isinf(x)\t__extension__ ( {\t\t\t\t\\\n\
+\t\t\tconst __typeof(x) __x_i = (x);\t\t\t\\\n\
+\t\t\t__builtin_expect(sizeof(__x_i) == sizeof(float)\t\\\n\
+\t\t\t? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n\
+\t\t\t: sizeof(__x_i) == sizeof(long double)\t\t\\\n\
+\t\t\t? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\\\n\
+\t\t\t: isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\\\n\
+\t})",
+    "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n\
+[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n\
+[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n\
+[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)",
+    (char*)NULL };
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  Description of Solaris_Mutex_Init_1 fix
@@ -8302,9 +8348,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          246
+#define REGEX_COUNT          247
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            204
+#define FIX_COUNT            205
 
 /*
  *  Enumerate the fixes
@@ -8446,6 +8492,7 @@ typedef enum {
     SOLARIS_MATH_7_FIXIDX,
     SOLARIS_MATH_8_FIXIDX,
     SOLARIS_MATH_9_FIXIDX,
+    SOLARIS_MATH_10_FIXIDX,
     SOLARIS_MUTEX_INIT_1_FIXIDX,
     SOLARIS_MUTEX_INIT_2_FIXIDX,
     SOLARIS_RWLOCK_INIT_1_FIXIDX,
@@ -9197,6 +9244,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SOLARIS_MATH_9_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSolaris_Math_9Tests,   apzSolaris_Math_9Patch, 0 },
 
+  {  zSolaris_Math_10Name,    zSolaris_Math_10List,
+     apzSolaris_Math_10Machs,
+     SOLARIS_MATH_10_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_Math_10Tests,   apzSolaris_Math_10Patch, 0 },
+
   {  zSolaris_Mutex_Init_1Name,    zSolaris_Mutex_Init_1List,
      apzSolaris_Mutex_Init_1Machs,
      SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY,
index 93e05780ad9fbcc8ee3f5728eed9498f0a7062e4..52940c5e68717a3020f3f635dac5ed0ef38b5ec9 100644 (file)
@@ -3089,6 +3089,36 @@ fix = {
     "#undef    isunordered\n"
     "#define   isunordered(x, y)       ((x) __builtin_isunordered(y))";
 };
+/*
+ * On Solaris 11, if you do isinf(NaN) you'll get a floating point
+ * exception. Provide an alternative using GCC's builtin macros.
+ */
+
+fix = {
+    hackname  = solaris_math_10;
+    select    = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files     = iso/math_c99.h;
+    c_fix     = format;
+    c_fix_arg = "#define isinf(x)\t__extension__ ( {\t\t\t\t\\\n"
+               "\t\t\tconst __typeof(x) __x_i = (x);\t\t\t\\\n"
+               "\t\t\t__builtin_expect(sizeof(__x_i) == sizeof(float)\t\\\n"
+               "\t\t\t? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n"
+               "\t\t\t: sizeof(__x_i) == sizeof(long double)\t\t\\\n"
+               "\t\t\t? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\\\n"
+               "\t\t\t: isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\\\n"
+               "\t})";
+    c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n"
+                "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n"
+                "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n"
+                "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)";
+    test_text =
+    '#pragma ident     "@(#)math_c99.h 1.12    07/01/21 SMI"'"\n"
+    "#undef    isinf\n"
+    "#define   isinf(x)        __extension__( \\\\\n"
+    "                  { __typeof(x) __x_i = (x); \\\\\n"
+    "                  __x_i == (__typeof(__x_i)) INFINITY || \\\\\n"
+    "                  __x_i == (__typeof(__x_i)) (-INFINITY); })";
+};
 
 /*
  *  Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER
index bc2b653424d4db89e56e379b526822b059986ef9..8df8f794e1f239b12cf44a1003dcd6d44f7ba9fc 100644 (file)
 #undef isunordered
 #define        isunordered(x, y)       __builtin_isunordered(x, y)
 #endif  /* SOLARIS_MATH_9_CHECK */
+
+
+#if defined( SOLARIS_MATH_10_CHECK )
+#pragma ident  "@(#)math_c99.h 1.12    07/01/21 SMI"
+#undef isinf
+#define isinf(x)       __extension__ ( {                               \
+                       const __typeof(x) __x_i = (x);                  \
+                       __builtin_expect(sizeof(__x_i) == sizeof(float) \
+                       ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \
+                       : sizeof(__x_i) == sizeof(long double)          \
+                       ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\
+                       : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\
+       })
+#endif  /* SOLARIS_MATH_10_CHECK */