diff mbox series

[14/19,GCC-8] aarch64: Fix store-exclusive in load-operate LSE helpers

Message ID e84b5d59-5ebd-1d0e-e36c-2fffe388b8f2@arm.com
State New
Headers show
Series aarch64: Backport outline atomics | expand

Commit Message

Andre Vieira (lists) April 16, 2020, 12:26 p.m. UTC
2020-04-16  Andre Vieira <andre.simoesdiasvieira@arm.com>

     Backport from mainline
     2019-09-25  Richard Henderson <richard.henderson@linaro.org>

     PR target/91834
     * config/aarch64/lse.S (LDNM): Ensure STXR output does not
     overlap the inputs.
diff mbox series

Patch

diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S
index a5f6673596c73c497156a6f128799cc43b400504..c7979382ad7770b61bb1c64d32ba2395963a9d7a 100644
--- a/libgcc/config/aarch64/lse.S
+++ b/libgcc/config/aarch64/lse.S
@@ -227,8 +227,8 @@  STARTFN	NAME(LDNM)
 8:	mov		s(tmp0), s(0)
 0:	LDXR		s(0), [x1]
 	OP		s(tmp1), s(0), s(tmp0)
-	STXR		w(tmp1), s(tmp1), [x1]
-	cbnz		w(tmp1), 0b
+	STXR		w(tmp2), s(tmp1), [x1]
+	cbnz		w(tmp2), 0b
 	ret
 
 ENDFN	NAME(LDNM)