Peter Dimov wrote:
Ben Hutchings wrote:
David M Garza wrote:
gdb's stack trace says:
#0 0x400f8e1 in boost::detail::atomic_increment (pw=0x40006cc4) at sp_counted_base_gcc_ia64.hpp:38
Since gdb is printing the pointers as 32-bit values, and pw is not 64-bit-aligned, it appears that your compiler is using the ILP32 convention (32-bit int, long and pointer types). I assumed the LP64 convention (64-bit long and pointer types, 32-bit int) when writing the assembly-language code in sp_counted_base_gcc_ia64.hpp because I wasn't aware that other conventions were in use on IA64. If the C++ code is compiled with an ILP32 convention then the assembly-language code will be completely broken. I may be able to adjust the code to work to detect the model at compile time and use 32-bit memory accesses if appropriate.
Another option is to just switch to 'int' and 32-bit accesses (as we did for PPC64 IIRC.)
Yes, that's another possibility, but it breaks binary compatibility -
surely a black mark against a bug fix? - and I would expect 32-bit
accesses to be a little less efficient. It's fairly easy to select at
compile time, in any case. I'm attaching a patch against Boost CVS HEAD
that should make it work with both 32-bit and 64-bit longs. Could you
test this on HP-UX, David?
Ben.
Index: boost/detail/sp_counted_base_gcc_ia64.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/detail/sp_counted_base_gcc_ia64.hpp,v
retrieving revision 1.2
diff -u -r1.2 sp_counted_base_gcc_ia64.hpp
--- boost/detail/sp_counted_base_gcc_ia64.hpp 18 May 2005 20:10:01 -0000 1.2
+++ boost/detail/sp_counted_base_gcc_ia64.hpp 12 Dec 2005 20:00:24 -0000
@@ -16,7 +16,9 @@
// Lock-free algorithm by Alexander Terekhov
//
+#include <climits>
#include <typeinfo>
+#include