Patchwork Fix C++ testcases for size_t vs intptr_t

login
register
mail settings
Submitter Bernd Schmidt
Date April 24, 2013, 9:59 a.m.
Message ID <5177AD1F.1020101@codesourcery.com>
Download mbox | patch
Permalink /patch/239126/
State New
Headers show

Comments

Bernd Schmidt - April 24, 2013, 9:59 a.m.
This fixes C++ testcases that used size_t when casting a pointer to
integer so that they use intptr_t instead. There's also an testcase
using pointer subtraction where ptrdiff_t is the correct choice, and a
fix to the ptrmem.C testcase to use sizeof on a function pointer rather
than a data pointer.  A similar patch for C testcases was already
applied last year.

Bootstrapped and tested on x86_64-linux. Ok?


Bernd
Gabriel Dos Reis - April 24, 2013, 2:50 p.m.
On Wed, Apr 24, 2013 at 4:59 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> This fixes C++ testcases that used size_t when casting a pointer to
> integer so that they use intptr_t instead. There's also an testcase
> using pointer subtraction where ptrdiff_t is the correct choice, and a
> fix to the ptrmem.C testcase to use sizeof on a function pointer rather
> than a data pointer.  A similar patch for C testcases was already
> applied last year.
>
> Bootstrapped and tested on x86_64-linux. Ok?
>
>
> Bernd

Yes, OK.  Thanks!

-- Gaby

Patch

    	gcc/testsuite/
    	* g++.old-deja/g++.mike/warn1.C (uintptr_t): Renamed from size_t.
    	Use __UINTPTR_TYPE__.  All uses changed.
    	* g++.dg/other/offsetof3.C (uintptr_t): Likewise.
    	* g++.dg/opt/switch3.C (uintptr_t): Likewise.
    	* g++.dg/init/array11.C (uintptr_t): Likewise.
    	* g++.dg/torture/pr41775.C (uintptr_t): Likewise.
    	* g++.dg/tree-ssa/pr21082.C (b, c): Use __PTRDIFF_TYPE__.
    	* g++.dg/debug/const2.C (b::d): Use __UINTPTR_TYPE__ instead of
    	__SIZE_TYPE__.
    	* g++.dg/parse/array-size2.C (foo): Likewise.
    	* g++.dg/compat/struct-layout-1_x1.h (test##n): Likewise.
    	* g++.dg/abi/offsetof.C (main): Likewise.
    	* g++.dg/eh/alias1.C (g): Likewise.
    	* g++.dg/init/static-init1.C (a): Likewise.
    	* g++.dg/init/struct1.C (struct bug): Likewise.
    	* g++.dg/init/struct2.C (saveOrLoad): Likewise.
    	* g++.dg/init/struct3.C (foobar): Likewise.
    	* g++.dg/torture/pr31579.C (a): Likewise.
    	* g++.dg/torture/pr32563.C (i): Likewise.
    	* g++.old-deja/g++.brendan/code-gen2.c (main): Use __UINTPTR_TYPE__
    	instead of __SIZE_TYPE__.
    	* g++.old-deja/g++.other/temporary1.C: Likewise.
    	* g++.old-deja/g++.pt/local1.C (setback): Likewise.
    	* g++.old-deja/g++.pt/spec16.C (foo): Likewise.
    	* g++.old-deja/g++.pt/local7.C (setback): Likewise.
    	* g++.old-deja/g++.mike/net42.C (get_stat): Likewise.
    	* g++.old-deja/g++.eh/ptr1.C (main): Likewise.
    	* g++.old-deja/g++.brendan/crash64.C (uintptr_t): Define and use
    	instead of size_t.
    	* g++.old-deja/g++.abi/ptrmem.C (VPTE_SIZE): Define using a function pointer.

diff --git a/gcc/testsuite/g++.dg/abi/offsetof.C b/gcc/testsuite/g++.dg/abi/offsetof.C
index d6a53e6..68ba2d8 100644
--- a/gcc/testsuite/g++.dg/abi/offsetof.C
+++ b/gcc/testsuite/g++.dg/abi/offsetof.C
@@ -18,5 +18,5 @@  struct C: public B { };
 
 int main ()
 {
-  return ((__SIZE_TYPE__) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }
+  return ((__UINTPTR_TYPE__) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }
 }
diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h
index e14433e..e304841 100644
--- a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h
+++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h
@@ -56,7 +56,7 @@  void test##n (void)						\
   info.als = __alignof__ (s##n);				\
   info.ala0 = __alignof__ (a##n[0]);				\
   info.ala3 = __alignof__ (a##n[3]);				\
-  if (((long) (__SIZE_TYPE__) &a##n[3]) & (info.als - 1))			\
+  if (((long) (__UINTPTR_TYPE__) &a##n[3]) & (info.als - 1))	\
     FAIL (n, 1);						\
   i = 0; j = 0;							\
   ops								\
diff --git a/gcc/testsuite/g++.dg/debug/const2.C b/gcc/testsuite/g++.dg/debug/const2.C
index 8e98f8b..3f075b8 100644
--- a/gcc/testsuite/g++.dg/debug/const2.C
+++ b/gcc/testsuite/g++.dg/debug/const2.C
@@ -12,4 +12,4 @@  struct b
   virtual bool IsEmpty() const=0;
   int e,c;
 };
-const int b::d = ((__SIZE_TYPE__)(&((b*)1)->c) - 1);
+const int b::d = ((__UINTPTR_TYPE__)(&((b*)1)->c) - 1);
diff --git a/gcc/testsuite/g++.dg/eh/alias1.C b/gcc/testsuite/g++.dg/eh/alias1.C
index e6af383..fc1ed64 100644
--- a/gcc/testsuite/g++.dg/eh/alias1.C
+++ b/gcc/testsuite/g++.dg/eh/alias1.C
@@ -16,7 +16,7 @@  void
 g (int i)
 {
   if (!i_glob)
-    exit ((__SIZE_TYPE__) & i);
+    exit ((__INTPTR_TYPE__) & i);
 }
 
 static void
diff --git a/gcc/testsuite/g++.dg/init/array11.C b/gcc/testsuite/g++.dg/init/array11.C
index e52effe..594678a 100644
--- a/gcc/testsuite/g++.dg/init/array11.C
+++ b/gcc/testsuite/g++.dg/init/array11.C
@@ -9,11 +9,11 @@ 
 
 int x;
 
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 
 struct gdt
 {
-size_t a,b,c,d,e,f;
+uintptr_t a,b,c,d,e,f;
 };
 void f()
 {
@@ -21,7 +21,7 @@  struct gdt gdt_table[2]=
 {
     {
 		0,
-		( (((size_t)(&x))<<(24))&(-1<<(8)) ),
+		( (((uintptr_t)(&x))<<(24))&(-1<<(8)) ),
     },
 };
 }
diff --git a/gcc/testsuite/g++.dg/init/static-init1.C b/gcc/testsuite/g++.dg/init/static-init1.C
index 298d171..6852dad 100644
--- a/gcc/testsuite/g++.dg/init/static-init1.C
+++ b/gcc/testsuite/g++.dg/init/static-init1.C
@@ -2,4 +2,4 @@ 
 // Make sure we don't think we can initialize a at compile time.
 
 char c;
-short a[] = { (short)((__PTRDIFF_TYPE__)&c + (__PTRDIFF_TYPE__)&c) };
+short a[] = { (short)((__UINTPTR_TYPE__)&c + (__UINTPTR_TYPE__)&c) };
diff --git a/gcc/testsuite/g++.dg/init/struct1.C b/gcc/testsuite/g++.dg/init/struct1.C
index e23faef..834dca1 100644
--- a/gcc/testsuite/g++.dg/init/struct1.C
+++ b/gcc/testsuite/g++.dg/init/struct1.C
@@ -1,6 +1,6 @@ 
 struct bug {
   const char *name;
-  __SIZE_TYPE__ type;
+  __UINTPTR_TYPE__ type;
 };
 
-struct bug s = { 0, (__SIZE_TYPE__) &s | 1 };
+struct bug s = { 0, (__UINTPTR_TYPE__) &s | 1 };
diff --git a/gcc/testsuite/g++.dg/init/struct2.C b/gcc/testsuite/g++.dg/init/struct2.C
index 85aacc6..53486c9 100644
--- a/gcc/testsuite/g++.dg/init/struct2.C
+++ b/gcc/testsuite/g++.dg/init/struct2.C
@@ -15,7 +15,7 @@  void saveOrLoad() {
     };    
 
     SaveLoadEntry trackEntries = {
-	((long) (__SIZE_TYPE__) (&((Track *) 42)->soundName[0])) - 42,
+	((long) (__UINTPTR_TYPE__) (&((Track *) 42)->soundName[0])) - 42,
         0, 1
     };
     saveLoadEntries(&trackEntries);
diff --git a/gcc/testsuite/g++.dg/init/struct3.C b/gcc/testsuite/g++.dg/init/struct3.C
index 53804b3..3571cdf 100644
--- a/gcc/testsuite/g++.dg/init/struct3.C
+++ b/gcc/testsuite/g++.dg/init/struct3.C
@@ -12,4 +12,4 @@  struct SaveLoadEntry {
   int size;
 };    
 
-int foobar = ((long) (__SIZE_TYPE__) (& ((Track *) 42)->soundName[0])) - 42;
+int foobar = ((long) (__UINTPTR_TYPE__) (& ((Track *) 42)->soundName[0])) - 42;
diff --git a/gcc/testsuite/g++.dg/opt/switch3.C b/gcc/testsuite/g++.dg/opt/switch3.C
index 643cac3..9fbb4cf 100644
--- a/gcc/testsuite/g++.dg/opt/switch3.C
+++ b/gcc/testsuite/g++.dg/opt/switch3.C
@@ -3,10 +3,10 @@ 
 // { dg-options "-O2" }
 
 void f (void);
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 void g (void *a)
 {
-  size_t b = (size_t) a;
+  uintptr_t b = (uintptr_t) a;
   switch (b)
   {
     case 1:
diff --git a/gcc/testsuite/g++.dg/other/offsetof3.C b/gcc/testsuite/g++.dg/other/offsetof3.C
index 5946c81..dc47b5a 100644
--- a/gcc/testsuite/g++.dg/other/offsetof3.C
+++ b/gcc/testsuite/g++.dg/other/offsetof3.C
@@ -11,7 +11,7 @@  protected:
 };
 
 typedef X* pX;
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 
-size_t yoff = size_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */
+uintptr_t yoff = uintptr_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */
 /* { dg-warning "macro was used incorrectly" "macro" { target *-*-* } 16 } */
diff --git a/gcc/testsuite/g++.dg/other/offsetof4.C b/gcc/testsuite/g++.dg/other/offsetof4.C
index ab2282e..4930591 100644
--- a/gcc/testsuite/g++.dg/other/offsetof4.C
+++ b/gcc/testsuite/g++.dg/other/offsetof4.C
@@ -11,6 +11,6 @@  struct X
 };
 
 typedef X* pX;
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 
-size_t yoff = size_t(&(pX(0)->y));
+uintptr_t yoff = uintptr_t(&(pX(0)->y));
diff --git a/gcc/testsuite/g++.dg/parse/array-size2.C b/gcc/testsuite/g++.dg/parse/array-size2.C
index 355ed61..94ec5fb 100644
--- a/gcc/testsuite/g++.dg/parse/array-size2.C
+++ b/gcc/testsuite/g++.dg/parse/array-size2.C
@@ -15,6 +15,6 @@  void
 foo (void)
 {
   char g[(char *) &((struct S *) 0)->b - (char *) 0];
-  char h[(__SIZE_TYPE__) &((struct S *) 8)->b];
+  char h[(__UINTPTR_TYPE__) &((struct S *) 8)->b];
   bar (g, h);
 }
diff --git a/gcc/testsuite/g++.dg/torture/pr31579.C b/gcc/testsuite/g++.dg/torture/pr31579.C
index 131532e..10cc1c8 100644
--- a/gcc/testsuite/g++.dg/torture/pr31579.C
+++ b/gcc/testsuite/g++.dg/torture/pr31579.C
@@ -5,6 +5,6 @@ 
 struct Industry {
  unsigned char produced_cargo[2];
 };
-unsigned int a = (((__SIZE_TYPE__)&reinterpret_cast<const volatile
+unsigned int a = (((__UINTPTR_TYPE__)&reinterpret_cast<const volatile
 char&>((((Industry*)(char*)8)->produced_cargo[0]))) - 8);
 
diff --git a/gcc/testsuite/g++.dg/torture/pr32563.C b/gcc/testsuite/g++.dg/torture/pr32563.C
index d536b3f..2d2f32a 100644
--- a/gcc/testsuite/g++.dg/torture/pr32563.C
+++ b/gcc/testsuite/g++.dg/torture/pr32563.C
@@ -5,4 +5,4 @@  struct A
   char c[1];
 } a;
 
-const __SIZE_TYPE__ i = (__SIZE_TYPE__)&a.c[0] - 1;
+const __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a.c[0] - 1;
diff --git a/gcc/testsuite/g++.dg/torture/pr41775.C b/gcc/testsuite/g++.dg/torture/pr41775.C
index 3d8548e..3951916 100644
--- a/gcc/testsuite/g++.dg/torture/pr41775.C
+++ b/gcc/testsuite/g++.dg/torture/pr41775.C
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
 
-typedef unsigned int size_t;
+typedef unsigned int uintptr_t;
 namespace std __attribute__ ((__visibility__ ("default")))
 {
   template < typename _Iterator > struct iterator_traits
@@ -42,14 +42,14 @@  extern "C"
 {
   extern "C"
   {
-    __extension__ typedef __SIZE_TYPE__ __intptr_t;
+    __extension__ typedef __UINTPTR_TYPE__ __intptr_t;
   }
 }
 namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
 {
   template < typename _Tp > class new_allocator
   {
-  public:typedef size_t size_type;
+  public:typedef uintptr_t uintptr_type;
     typedef _Tp *pointer;
     template < typename _Tp1 > struct rebind
     {
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr21082.C b/gcc/testsuite/g++.dg/tree-ssa/pr21082.C
index d6c2fa1..f421af6 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr21082.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr21082.C
@@ -4,7 +4,7 @@ 
 void link_error();
 
 int a[4];
-__INTPTR_TYPE__ b, c;
+__PTRDIFF_TYPE__ b, c;
 
 int main()
 {
diff --git a/gcc/testsuite/g++.dg/warn/pr33160.C b/gcc/testsuite/g++.dg/warn/pr33160.C
index e463e2d..a24e105 100644
--- a/gcc/testsuite/g++.dg/warn/pr33160.C
+++ b/gcc/testsuite/g++.dg/warn/pr33160.C
@@ -2,7 +2,7 @@ 
 // { dg-do compile }
 // { dg-options "-Wall -Wextra -Wpointer-arith -pedantic -Wconversion" }
 
-typedef int __attribute__((mode(pointer))) intptr_t;
+typedef __INTPTR_TYPE__ intptr_t;
 int foo(void)
 {
  intptr_t t = 0;
diff --git a/gcc/testsuite/g++.dg/warn/sequence-pt-1.C b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C
index 6a98fd7..dd8dbc1 100644
--- a/gcc/testsuite/g++.dg/warn/sequence-pt-1.C
+++ b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C
@@ -15,7 +15,7 @@  extern int fnb (int, int);
 extern int fnc (int *);
 extern int sprintf (char *, const char *, ...);
 
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 
 void
 foo (int a, int b, int n, int p, int *ptr, struct s *sptr,
@@ -32,9 +32,9 @@  foo (int a, int b, int n, int p, int *ptr, struct s *sptr,
   ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */
   cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" } */
   cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */
-  *ptr++ = (size_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */
+  *ptr++ = (uintptr_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */
   sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" } */
-  sptr->a = (size_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */
+  sptr->a = (uintptr_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */
   *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */
   a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */
   b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
index 3417358..b72db88 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
@@ -22,7 +22,7 @@ 
 #define VPTE_SIZE	(16)
 #else
 #define CMP_PTRFN(A, B) ((A) == (B))
-#define VPTE_SIZE	sizeof(void *)
+#define VPTE_SIZE	sizeof(void (*)())
 #endif
 
 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C
index 730f0f9..76865e4 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen2.C
@@ -10,7 +10,7 @@  int main ()
 	char buff[40] ;
 	char *tmp = &buff[0];	// also fails for char *tmp = buff;
 
-	if ((__SIZE_TYPE__) tmp != (__SIZE_TYPE__) &buff[0])
+	if ((__UINTPTR_TYPE__) tmp != (__UINTPTR_TYPE__) &buff[0])
 	  { printf ("FAIL\n"); return 1; }
 	else
 	  printf ("PASS\n");
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C
index 5fd31a6..f7fe100 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C
@@ -1,6 +1,6 @@ 
 // { dg-do assemble { target c++98 } }
 // GROUPS passed old-abort
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 typedef void (*RF_Ptr)(void *);
 
 struct _im_pers_mem_spec {
@@ -16,4 +16,4 @@  struct metatype { int base_list; };
 
 static _type_desc _type_metatype("metatype", sizeof(metatype),
   (RF_Ptr)0, 0, 1, 1,
-  _im_pers_mem_spec( ((size_t)&((( metatype *)0)-> base_list )) , 1));
+  _im_pers_mem_spec( ((uintptr_t)&((( metatype *)0)-> base_list )) , 1));
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C b/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C
index aefe5cc..a522b4c 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C
@@ -16,8 +16,8 @@  int main()
   }
 
   catch (E *&e) {
-    printf ("address of e is 0x%lx\n", (__SIZE_TYPE__)e);
-    return !((__SIZE_TYPE__)e != 5 && e->x == 5);
+    printf ("address of e is 0x%lx\n", (__UINTPTR_TYPE__)e);
+    return !((__UINTPTR_TYPE__)e != 5 && e->x == 5);
   }
   return 2;
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net42.C b/gcc/testsuite/g++.old-deja/g++.mike/net42.C
index 1205812..4d19c22 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/net42.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net42.C
@@ -16,7 +16,7 @@  get_stat() {
   unsigned long bit = 1;
   unsigned long sigignore = 0;
   int i = 0;
-  switch((__SIZE_TYPE__) (*p)->sigaction[i].sa_handler)
+  switch((__UINTPTR_TYPE__) (*p)->sigaction[i].sa_handler)
     {
     case 1:
       sigignore |= bit;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C
index 5d6fdec..203acaf 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C
@@ -2,9 +2,9 @@ 
 // { dg-options "-Wall -Wno-int-to-pointer-cast" }
 
 typedef char * charptr;
-typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
 char c[]={'A','B','C','D'};
-int i=size_t(&c);
+int i=uintptr_t(&c);
 int *pp=&i;
 void foo() { }
 int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
index b1c8cd6..ea63ac3 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
@@ -5,16 +5,16 @@  int c, d;
 class Foo 
 {
 public:
-   Foo() { printf("Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++c; }
-   Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); }
-   ~Foo() { printf("~Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++d; }
+   Foo() { printf("Foo() 0x%08lx\n", (__UINTPTR_TYPE__)this); ++c; }
+   Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__UINTPTR_TYPE__)this); }
+   ~Foo() { printf("~Foo() 0x%08lx\n", (__UINTPTR_TYPE__)this); ++d; }
 };
 
 // Bar creates constructs a temporary Foo() as a default
 class Bar 
 {
 public:
-   Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); }
+   Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (__UINTPTR_TYPE__)this); }
 };
 
 void fakeRef(Bar *)
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local1.C b/gcc/testsuite/g++.old-deja/g++.pt/local1.C
index d73a030..08e32b3 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/local1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/local1.C
@@ -5,7 +5,7 @@  setback(MEMBER *bp, MEMBER STRUCT::*offset)
         if(!bp) return 0;
         union { int i; MEMBER STRUCT::*of; } u;
         u.of = offset;
-        return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
+        return (STRUCT *) ((__UINTPTR_TYPE__) bp - u.i);
 }
  
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local7.C b/gcc/testsuite/g++.old-deja/g++.pt/local7.C
index 96b19fc..206bbad 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/local7.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/local7.C
@@ -6,7 +6,7 @@  setback(MEMBER *bp, MEMBER STRUCT::*offset)
         if(!bp) return 0;
         union { int i; MEMBER STRUCT::*of; } u;
         u.of = offset;
-        return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
+        return (STRUCT *) ((__UINTPTR_TYPE__) bp - u.i);
 }
  
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec16.C b/gcc/testsuite/g++.old-deja/g++.pt/spec16.C
index dbe4426..3c453b5 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec16.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec16.C
@@ -17,5 +17,5 @@  template<>
 int
 A<const char*>::foo(const char*const& k)
 {
-        return((__SIZE_TYPE__)k);
+        return((__UINTPTR_TYPE__)k);
 }