https://gcc.gnu.org/g:ca70335ceab761f3c3a365d0667ad824a7bf6822

commit r16-7392-gca70335ceab761f3c3a365d0667ad824a7bf6822
Author: Jonathan Yong <[email protected]>
Date:   Sun Feb 8 03:30:54 2026 +0000

    gcc.target/i386/pr63542-2.c: Fix llp64 casts
    
    Fix compile warnings with mingw-w64.
    
    Signed-off-by: Jonathan Yong <[email protected]>
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr63542-2.c: Change long unsigned casts
            to __UINTPTR_TYPE__.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr63542-2.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr63542-2.c 
b/gcc/testsuite/gcc.target/i386/pr63542-2.c
index e9e9d8443640..78e33d59479e 100644
--- a/gcc/testsuite/gcc.target/i386/pr63542-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr63542-2.c
@@ -3,7 +3,7 @@
 /* { dg-options "-O2 -g -dA" } */
 /* { dg-additional-options "-fpic" { target fpic } } */
 
-struct B { unsigned long c; unsigned char *d; };
+struct B { __UINTPTR_TYPE__ c; unsigned char *d; };
 extern struct A { struct B *e[0x400]; } *f[128];
 extern void (*bar) (char *p, char *q);
 
@@ -12,19 +12,19 @@ foo (char *p, char *q)
 {
   struct B *g;
   char *b, *l;
-  unsigned long s;
+  __UINTPTR_TYPE__ s;
 
-  g = f[((unsigned long) p) >> 22]->e[(((unsigned long) p) >> 12) & 0x3ff];
+  g = f[((__UINTPTR_TYPE__) p) >> 22]->e[(((__UINTPTR_TYPE__) p) >> 12) & 
0x3ff];
   s = g->c << 2;
-  int r = ((unsigned long) p) & 0xfff;
+  int r = ((__UINTPTR_TYPE__) p) & 0xfff;
   int m = g->d[r];
   if (m > 0xfd)
     {
       m = (r >> 2) % (s >> 2);
-      if ((((unsigned long) p) & ~(unsigned long) 0xfff) != (((unsigned long) 
q) & ~(unsigned long) 0xfff))
+      if ((((__UINTPTR_TYPE__) p) & ~(__UINTPTR_TYPE__) 0xfff) != 
(((__UINTPTR_TYPE__) q) & ~(__UINTPTR_TYPE__) 0xfff))
        goto fail;
     }
-  b = (char *) ((unsigned long) p & ~(unsigned long) 3);
+  b = (char *) ((__UINTPTR_TYPE__) p & ~(__UINTPTR_TYPE__) 3);
   b -= m << 2;
   l = b + s;

Reply via email to