
Alexander Churanov wrote:
Folks,
Boost 1.40.0 beta 1 fail to build on SPARC64 machines. 1.37, however, builds flawlessly.
Brief analysis indicates that the issue arises when code of smart_ptr is assembled.
...
The attached patch allows the code to build.
Doesn't seem right to me. How about - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) - : "memory" ); + __asm__ __volatile__( "cas [%1], %2, %0" + : "+r" (swap_) + : "r" (dest_), "r" (compare_) + : "memory" ); ?
What is the appropriate way to check that the patched code works correctly both in terms of logic and atomicity?
You should run the smart_ptr tests, including shared_ptr_mt_test and weak_ptr_mt_test, on a multicore machine.