On 11/03/11 15:22, Joseph S. Myers wrote:
On Thu, 3 Nov 2011, Aldy Hernandez wrote:
+#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long long ptrcast;
+#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long ptrcast;
+#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
+typedef unsigned int ptrcast;
+#else
+#error Add target support here
+#endif
Using __UINTPTR_TYPE__ (or including<stdint.h> and using uintptr_t) would
seem better.
Fixed and committed to branch.
Thanks.
* testsuite/gcc.dg/alias-1.c: Use __UINTPTR_TYPE__.
* testsuite/gcc.dg/alias-2.c: Use __UINTPTR_TYPE__.
Index: testsuite/gcc.dg/tm/alias-1.c
===================================================================
--- testsuite/gcc.dg/tm/alias-1.c (revision 180744)
+++ testsuite/gcc.dg/tm/alias-1.c (working copy)
@@ -1,15 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */
-#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long long ptrcast;
-#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long ptrcast;
-#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
-typedef unsigned int ptrcast;
-#else
-#error Add target support here
-#endif
+typedef __UINTPTR_TYPE__ ptrcast;
#if (__SIZEOF_POINTER__ == 4)
#define TM_LOAD __builtin__ITM_RU4
Index: testsuite/gcc.dg/tm/alias-2.c
===================================================================
--- testsuite/gcc.dg/tm/alias-2.c (revision 180744)
+++ testsuite/gcc.dg/tm/alias-2.c (working copy)
@@ -1,15 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */
-#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long long ptrcast;
-#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long ptrcast;
-#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
-typedef unsigned int ptrcast;
-#else
-#error Add target support here
-#endif
+typedef __UINTPTR_TYPE__ ptrcast;
#if (__SIZEOF_POINTER__ == 4)
#define TM_LOAD __builtin__ITM_RU4