about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Larsson <andreas@gaisler.com>2023-11-15 13:29:43 +0100
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-11-15 10:26:37 -0300
commit578190b7e43305141512dee777e4a3b3e8159393 (patch)
tree159a93d879876cadb2f3ff465d7075d6d82e6daa
parentbaea60b33ec52e413cffad59d7dc54957377ac14 (diff)
downloadglibc-578190b7e43305141512dee777e4a3b3e8159393.tar.gz
glibc-578190b7e43305141512dee777e4a3b3e8159393.tar.xz
glibc-578190b7e43305141512dee777e4a3b3e8159393.zip
sparc: Fix broken memset for sparc32 [BZ #31068]
Fixes commit a61933fe27df ("sparc: Remove bzero optimization") that
after moving code jumped to the wrong label 4.

Verfied by successfully running string/test-memset on sparc32.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
-rw-r--r--sysdeps/sparc/sparc32/memset.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S
index ca29ff5685..1dc3a640e8 100644
--- a/sysdeps/sparc/sparc32/memset.S
+++ b/sysdeps/sparc/sparc32/memset.S
@@ -55,7 +55,7 @@ ENTRY(memset)
 
 	andcc		%o0, 3, %o2
 	bne		3f
-4:	 andcc		%o0, 4, %g0
+5:	 andcc		%o0, 4, %g0
 
 	be		2f
 	 mov		%g3, %g2
@@ -139,7 +139,7 @@ ENTRY(memset)
 	stb		%g3, [%o0 + 0x02]
 2:	sub		%o2, 4, %o2
 	add		%o1, %o2, %o1
-	b		4b
+	b		5b
 	 sub		%o0, %o2, %o0
 END(memset)
 libc_hidden_builtin_def (memset)