This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.5 C] Update tgmath.h fix
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Nov 2008 17:07:27 +0000 (UTC)
- Subject: [4.5 C] Update tgmath.h fix
The version of the tgmath.h Ulrich committed to glibc allowed for complex
integers, which my patch didn't. I've applied this patch to c-4_5-branch
to make the fix use the same definition as glibc tgmath.h now does for
current compilers, and to make the bypass also match the definition that
went into glibc.
Index: ChangeLog.c45
===================================================================
--- ChangeLog.c45 (revision 141578)
+++ ChangeLog.c45 (working copy)
@@ -1,3 +1,10 @@
+2008-11-04 Joseph Myers <joseph@codesourcery.com>
+
+ * inclhack.def (glibc_tgmath): Update fix in line with current
+ glibc.
+ * fixincl.x: Regenerate.
+ * tests/base/tgmath.h: Update.
+
2008-10-24 Joseph Myers <joseph@codesourcery.com>
PR c/456
Index: fixincl.x
===================================================================
--- fixincl.x (revision 141578)
+++ fixincl.x (working copy)
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Friday October 24, 2008 at 07:30:25 PM UTC
+ * It has been AutoGen-ed Tuesday November 4, 2008 at 01:31:18 PM UTC
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Oct 24 19:30:25 UTC 2008
+/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Nov 4 13:31:18 UTC 2008
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -2290,7 +2290,8 @@
* content bypass pattern - skip fix if pattern found
*/
tSCC zGlibc_TgmathBypass0[] =
- "__floating_type.*__builtin_classify_type";
+ "__floating_type \\\\\n\
+.*__builtin_classify_type";
#define GLIBC_TGMATH_TEST_CT 2
static tTestDesc aGlibc_TgmathTests[] = {
@@ -2302,7 +2303,7 @@
*/
static const char* apzGlibc_TgmathPatch[] = {
"format",
- "(__builtin_classify_type ((type) 0) == 8 || __builtin_classify_type ((type) 0) == 9)",
+ "(__builtin_classify_type ((type) 0) == 8 || (__builtin_classify_type ((type) 0) == 9 && __builtin_classify_type (__real__ ((type) 0)) == 8))",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
Index: tests/base/tgmath.h
===================================================================
--- tests/base/tgmath.h (revision 141578)
+++ tests/base/tgmath.h (working copy)
@@ -10,5 +10,5 @@
#if defined( GLIBC_TGMATH_CHECK )
-# define __floating_type(type) (__builtin_classify_type ((type) 0) == 8 || __builtin_classify_type ((type) 0) == 9)
+# define __floating_type(type) (__builtin_classify_type ((type) 0) == 8 || (__builtin_classify_type ((type) 0) == 9 && __builtin_classify_type (__real__ ((type) 0)) == 8))
#endif /* GLIBC_TGMATH_CHECK */
Index: inclhack.def
===================================================================
--- inclhack.def (revision 141578)
+++ inclhack.def (working copy)
@@ -1296,9 +1296,9 @@
hackname = glibc_tgmath;
files = tgmath.h;
select = '\(\(\(type\) 0.25\) && \(\(type\) 0.25 - 1\)\)';
- bypass = "__floating_type.*__builtin_classify_type";
+ bypass = "__floating_type \\\\\n.*__builtin_classify_type";
c_fix = format;
- c_fix_arg = "(__builtin_classify_type ((type) 0) == 8 || __builtin_classify_type ((type) 0) == 9)";
+ c_fix_arg = "(__builtin_classify_type ((type) 0) == 8 || (__builtin_classify_type ((type) 0) == 9 && __builtin_classify_type (__real__ ((type) 0)) == 8))";
test_text = "# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))";
};
--
Joseph S. Myers
joseph@codesourcery.com