--- boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp.orig 2009-03-02 11:22:16.000000000 -0500 +++ boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp 2009-11-12 07:59:17.000000000 -0500 @@ -30,11 +30,14 @@ inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) - : "memory" ); - + int32_t& ref(*dest_); + + __asm__ __volatile__( "mov %0, %%g0" "\n\t" + "cas [%%g0], %2, %1" + : "+r" (swap_) + : "r" (&ref), "r" (compare_) + : "%g0", "memory" ); + return swap_; }