[AArch64] Fix PR target/91834
diff mbox series

Message ID 20190921061107.6388-1-richard.henderson@linaro.org
State New
Headers show
Series
  • [AArch64] Fix PR target/91834
Related show

Commit Message

Richard Henderson Sept. 21, 2019, 6:11 a.m. UTC
As diagnosed in the PR.

	* config/aarch64/lse.S (LDNM): Ensure STXR output does not
	overlap the inputs.
---
 libgcc/config/aarch64/lse.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kyrill Tkachov Sept. 23, 2019, 8:48 a.m. UTC | #1
On 9/21/19 7:11 AM, Richard Henderson wrote:
> As diagnosed in the PR.
>
>         * config/aarch64/lse.S (LDNM): Ensure STXR output does not
>         overlap the inputs.


Looks good to me. Perhaps even obvious.

Thanks,

Kyrill


> ---
>  libgcc/config/aarch64/lse.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S
> index a5f6673596c..c7979382ad7 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)
> -- 
> 2.17.1
>

Patch
diff mbox series

diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S
index a5f6673596c..c7979382ad7 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)