diff options
Diffstat (limited to 'libstdc++-v3/config/cpu/sparc/atomicity.h')
-rw-r--r-- | libstdc++-v3/config/cpu/sparc/atomicity.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libstdc++-v3/config/cpu/sparc/atomicity.h b/libstdc++-v3/config/cpu/sparc/atomicity.h index 23804db00b7..de044d9c619 100644 --- a/libstdc++-v3/config/cpu/sparc/atomicity.h +++ b/libstdc++-v3/config/cpu/sparc/atomicity.h @@ -39,6 +39,7 @@ __attribute__ ((__unused__)) __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" @@ -47,7 +48,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val) " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val) + : "r" (__mem), "r" (__val_extended) : "memory"); return __tmp2; } @@ -57,6 +58,7 @@ __attribute__ ((__unused__)) __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" @@ -65,7 +67,7 @@ __atomic_add (volatile _Atomic_word* __mem, int __val) " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val) + : "r" (__mem), "r" (__val_extended) : "memory"); } |