From: Jakub Jelinek <jakub@redhat.com>
To: Roland McGrath <roland@redhat.com>,
Ulrich Drepper <drepper@redhat.com>,
David Mosberger <davidm@hpl.hp.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix IA-64 strncpy
Date: Fri, 01 Nov 2002 12:43:00 -0000 [thread overview]
Message-ID: <20021101214315.D3451@sunsite.ms.mff.cuni.cz> (raw)
Hi!
Testcase in http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76952
shows the change in .recovery3 was wrong and in .recovery4 it used to
be off by 8 previously and then changed 8 bytes off in the other direction.
Here is why .recovery3 needs to subtract 24 from src:
#define MEMLAT 2
(p[0]) ld8.s r[0] = [src], 8
(p[MEMLAT]) chk.s r[MEMLAT], .recovery3
First cycle just executes the first insn, likewise second (that is src
is twice incremented by 8) and in the third cycle first it loads and
increments src by 8, then checks the load from the first cycle, at which
point src is 24 bytes bigger than the first load.
Tested using stratcliff and my test-strncpy.c (I'm ATM partly cleaning up
the various stringops testers I have and will submit them separately).
2002-11-01 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ia64/strncpy.S: Fix recovery code.
--- libc/sysdeps/ia64/strncpy.S.jj 2002-10-02 10:26:37.000000000 +0200
+++ libc/sysdeps/ia64/strncpy.S 2002-11-01 14:53:07.000000000 +0100
@@ -217,11 +217,11 @@ ENTRY(strncpy)
(p5) mov r[0] = r0
br.cond.sptk .back2
.recovery3:
- add tmp = -MEMLAT * 8, src ;;
+ add tmp = -(MEMLAT + 1) * 8, src ;;
ld8 r[MEMLAT] = [tmp]
br.cond.sptk .back3
.recovery4:
- add tmp = -(MEMLAT - 1) * 8, src ;;
+ add tmp = -MEMLAT * 8, src ;;
ld8 r[MEMLAT - 1] = [tmp]
br.cond.sptk .back4
END(strncpy)
Jakub
reply other threads:[~2002-11-01 20:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021101214315.D3451@sunsite.ms.mff.cuni.cz \
--to=jakub@redhat.com \
--cc=davidm@hpl.hp.com \
--cc=drepper@redhat.com \
--cc=libc-hacker@sources.redhat.com \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).