
Sounds like a gcc bug. Which versions of gcc have you tried?
I have gcc 4.1.1 on a solaris10 sparv9 machine (64 bit).
I'm done some experimenting and with the following code, gcc seems to generate the proper code:
inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { __asm__ __volatile__( "cas [%2], %3, %0"
: "=&r" (swap_) : "0" (swap_), "r" (dest_), "r" (compare_) : "memory" );
return swap_; }
We might be able to use that as a fix if it works, but it's not correct in principle. One case where it fails is on 64 bit machines that use 32 bit pointers. This may not be a problem on SPARCs though.
I'm not sure how one would go about using 32-bit pointers on a 64-bit machine. Is that a gcc option or a hardwired thing in the processor?
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost