about summary refs log tree commit diff
path: root/sysdeps/ia64/memchr.S
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-11-20 08:30:20 -0800
committerPetr Baudis <pasky@ucw.cz>2009-11-20 20:23:35 +0100
commit8d7c09b162cd1687e21549f9aaaa3d4a9b39735c (patch)
tree092695439807b32772d8ffe90d49881dbdf0e89f /sysdeps/ia64/memchr.S
parent1bc1954c735788ae9e7f954e18cf39a22f964d06 (diff)
downloadglibc-8d7c09b162cd1687e21549f9aaaa3d4a9b39735c.tar.gz
glibc-8d7c09b162cd1687e21549f9aaaa3d4a9b39735c.tar.xz
glibc-8d7c09b162cd1687e21549f9aaaa3d4a9b39735c.zip
Properly recover from shorter read.
(cherry picked from commit 66221417957963c1d2df8d79f43573e328df2275)
Diffstat (limited to 'sysdeps/ia64/memchr.S')
-rw-r--r--sysdeps/ia64/memchr.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index cd062b2dd5..cdd71ca5a5 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -126,7 +126,16 @@ ENTRY(__memchr)
 	br.ret.sptk.many b0
 
 .recovery:
-	adds	ret0 = -((MEMLAT + 1) * 8), ret0;;
+#if MEMLAT != 6
+# error "MEMLAT must be 6!"
+#endif
+(p[MEMLAT-6])	add	ret0 = -8, ret0;;
+(p[MEMLAT-5])	add	ret0 = -8, ret0;;
+(p[MEMLAT-4])	add	ret0 = -8, ret0;;
+(p[MEMLAT-3])	add	ret0 = -8, ret0;;
+(p[MEMLAT-2])	add	ret0 = -8, ret0;;
+(p[MEMLAT-1])	add	ret0 = -8, ret0;;
+(p[MEMLAT])	add	ret0 = -8, ret0;;
 (p[MEMLAT+1])	add	ret0 = -8, ret0;;
 (p[MEMLAT+2])	add	ret0 = -8, ret0;;
 .l4: