From e203404e8e863684181345f2aecc25b065261231 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 22 Apr 2004 22:16:11 +0000 Subject: [PATCH] ia64intrin.h: Add intermediate cast to void * to avoid aliasing warning. * config/ia64/ia64intrin.h: Add intermediate cast to void * to avoid aliasing warning. From-SVN: r81059 --- gcc/ChangeLog | 5 +++ gcc/config/ia64/ia64intrin.h | 64 ++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b13dc235231..2a805a2fdba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-04-23 Andreas Schwab + + * config/ia64/ia64intrin.h: Add intermediate cast to void * to + avoid aliasing warning. + 2004-04-22 Jan Hubicka * cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro diff --git a/gcc/config/ia64/ia64intrin.h b/gcc/config/ia64/ia64intrin.h index 262dc20e4d0..2397c4ccde8 100644 --- a/gcc/config/ia64/ia64intrin.h +++ b/gcc/config/ia64/ia64intrin.h @@ -14,114 +14,114 @@ extern long __sync_val_compare_and_swap_di (long *, long, long); #define __sync_val_compare_and_swap(PTR, OLD, NEW) \ ((sizeof (*(PTR)) == sizeof(int)) \ ? (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \ + __sync_val_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ : (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW))) + __sync_val_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) extern int __sync_bool_compare_and_swap_si (int *, int, int); extern int __sync_bool_compare_and_swap_di (long *, long, long); #define __sync_bool_compare_and_swap(PTR, OLD, NEW) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \ - : __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW))) + ? __sync_bool_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ + : __sync_bool_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) extern void __sync_lock_release_si (int *); extern void __sync_lock_release_di (long *); #define __sync_lock_release(PTR) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_lock_release_si((int *)(PTR)) \ - : __sync_lock_release_di((long *)(PTR))) + ? __sync_lock_release_si((int *)(void *)(PTR)) \ + : __sync_lock_release_di((long *)(void *)(PTR))) extern int __sync_lock_test_and_set_si (int *, int); extern long __sync_lock_test_and_set_di (long *, long); #define __sync_lock_test_and_set(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_add_si (int *, int); extern long __sync_fetch_and_add_di (long *, long); #define __sync_fetch_and_add(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_sub_si (int *, int); extern long __sync_fetch_and_sub_di (long *, long); #define __sync_fetch_and_sub(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_and_si (int *, int); extern long __sync_fetch_and_and_di (long *, long); #define __sync_fetch_and_and(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_or_si (int *, int); extern long __sync_fetch_and_or_di (long *, long); #define __sync_fetch_and_or(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_xor_si (int *, int); extern long __sync_fetch_and_xor_di (long *, long); #define __sync_fetch_and_xor(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_fetch_and_nand_si (int *, int); extern long __sync_fetch_and_nand_di (long *, long); #define __sync_fetch_and_nand(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_add_and_fetch_si (int *, int); extern long __sync_add_and_fetch_di (long *, long); #define __sync_add_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_sub_and_fetch_si (int *, int); extern long __sync_sub_and_fetch_di (long *, long); #define __sync_sub_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_and_and_fetch_si (int *, int); extern long __sync_and_and_fetch_di (long *, long); #define __sync_and_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_or_and_fetch_si (int *, int); extern long __sync_or_and_fetch_di (long *, long); #define __sync_or_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_xor_and_fetch_si (int *, int); extern long __sync_xor_and_fetch_di (long *, long); #define __sync_xor_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) extern int __sync_nand_and_fetch_si (int *, int); extern long __sync_nand_and_fetch_di (long *, long); #define __sync_nand_and_fetch(PTR,VAL) \ ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(PTR),(long)(VAL))) + ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) #ifdef __cplusplus } -- 2.30.2