Does __sync_bool_compare_and_swap on ia64 have wrong return type?
H. J. Lu
hjl@lucon.org
Wed Apr 23 23:11:00 GMT 2003
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.
More information about the Gcc
mailing list