]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hppa: Fix asm in atomic_store_8 in sync-libfuncs.c
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 25 Sep 2025 14:49:39 +0000 (10:49 -0400)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 25 Sep 2025 14:49:39 +0000 (10:49 -0400)
Fix typo in the asm in atomic_store_8.  Also correct floating
point store.

Reported by Nick Hudson for netbsd.

2025-09-25  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

* config/pa/sync-libfuncs.c (atomic_store_8): Fix asm.

libgcc/config/pa/sync-libfuncs.c

index 774c1605572b1504e6e03e7e3dcd62a0f1405adf..28d08caeb6c141c44096b3c2659c8dfabf9fc33e 100644 (file)
@@ -133,11 +133,11 @@ atomic_store_8 (volatile void *ptr, u64 value)
 {
   double tmp;
 
-  asm volatile ("stws|stw} %2,-16(%%sp)\n\t"
-               "{stws|stw} %R2,-12(%%sp)\n\t"
-               "{fldds|fldd} -16(%%sp),%1\n\t"
-               "{fstds|fstd} %1,0(%0)"
-               : "=m" (ptr), "=&f" (tmp) : "r" (value): "memory");
+  asm volatile ("{stws|stw} %1,-16(%%sp)\n\t"
+               "{stws|stw} %R1,-12(%%sp)\n\t"
+               "{fldds|fldd} -16(%%sp),%0\n\t"
+               : "=f" (tmp) : "r" (value): "memory");
+  *(volatile double *)ptr = tmp;
 }
 #endif