diff mbox series

[4/4] sparc: Fix sparc64 memmove length comparison (BZ 31266)

Message ID 20240118160228.741832-5-adhemerval.zanella@linaro.org
State Accepted
Commit 926a4bdbb5fc8955570208b5571b2d04c6ffbd1d
Headers show
Series Multiple sparc fixes | expand

Commit Message

Adhemerval Zanella Netto Jan. 18, 2024, 4:02 p.m. UTC
The small counts copy bytes comparsion should be unsigned (as the
memmove size argument).  It fixes string/tst-memmove-overflow on
sparcv9, where the input size triggers an invalid code path.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
---
 sysdeps/sparc/sparc64/memmove.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S
index 8803a03d4e..f14b09afaf 100644
--- a/sysdeps/sparc/sparc64/memmove.S
+++ b/sysdeps/sparc/sparc64/memmove.S
@@ -38,7 +38,7 @@  ENTRY(memmove)
 /*
  * normal, copy forwards
  */
-2:	ble	%XCC, .Ldbytecp
+2:	bleu	%XCC, .Ldbytecp
 	 andcc	%o1, 3, %o5	/* is src word aligned  */
 	bz,pn	%icc, .Laldst
 	 cmp	%o5, 2		/* is src half-word aligned  */