This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Does __sync_bool_compare_and_swap on ia64 have wrong return type?
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 23 Apr 2003 15:33:55 -0700
- Subject: Does __sync_bool_compare_and_swap on ia64 have wrong return type?
According to the ia64 psABI, __sync_bool_compare_and_swap is
extern int __sync_bool_compare_and_swap (type *ptr, type old, int new);
where type may be one of signed or unsigned int, long and long long.
But gcc has
extern int __sync_bool_compare_and_swap_si (int *, int, int);
extern long __sync_bool_compare_and_swap_di (long *, long, long);
#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \
((sizeof (*(PTR)) == sizeof(int)) \
? (__typeof__(*(PTR))) \
__sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \
: (__typeof__(*(PTR))) \
__sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
__sync_bool_compare_and_swap in gcc may return signed or unsigned int,
long or long long.
H.J.