+2003-12-08 David S. Miller <davem@redhat.com>
+
+ PR libstdc++/12496
+ * config/cpu/sparc/atomicity.h (__exchange_and_add, __atomic_add):
+ Extend increment to _Atomic_word before giving to assembler.
+
2003-12-06 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/ext/enc_filebuf/char/13189.cc: Guard for __enc_traits.
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
- : "r" (__mem), "r" (__val)
+ : "r" (__mem), "r" (__val_extended)
: "memory");
return __tmp2;
}
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
__asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
: "=&r" (__tmp1), "=&r" (__tmp2)
- : "r" (__mem), "r" (__val)
+ : "r" (__mem), "r" (__val_extended)
: "memory");
}