Patchwork 10/n: trans-mem: compiler tests (1 of 3)

login
register
mail settings
Submitter Aldy Hernandez
Date Nov. 3, 2011, 9:37 p.m.
Message ID <4EB30988.70107@redhat.com>
Download mbox | patch
Permalink /patch/123510/
State New
Headers show

Comments

Aldy Hernandez - Nov. 3, 2011, 9:37 p.m.
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__.

Patch

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