public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug string/31266] New: sparc: string/tst-memmove-overflow fails on 32-bit sparcv9
Date: Thu, 18 Jan 2024 15:28:06 +0000	[thread overview]
Message-ID: <bug-31266-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=31266

            Bug ID: 31266
           Summary: sparc: string/tst-memmove-overflow fails on 32-bit
                    sparcv9
           Product: glibc
           Version: 2.27
            Status: NEW
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: adhemerval.zanella at linaro dot org
  Target Milestone: ---

The sparcv9 uses the generic sparc64 sysdeps/sparc/sparc64/memmove.S
implementation and the initial size test is done with a signed comparison:

ENTRY(memmove)
        mov     %o0, %g2        /* Save pointer to destination  */
        cmp     %o1, %o0        /* if from address is >= to use forward copy 
*/
        bgeu,a  %XCC, 2f        /* else use backward if ...  */
         cmp    %o2, 17         /* delay slot, for small counts copy bytes  */

        sub     %o0, %o1, %o4   /* get difference of two addresses  */
        cmp     %o2, %o4        /* compare size and difference of addresses  */
        bgu     %XCC, .Lovbc    /* if size is bigger, have to do overlapped
copy  */
         cmp    %o2, 17         /* delay slot, for small counts copy bytes  */
/*
 * normal, copy forwards
 */
2:      ble    %XCC, .Ldbytecp
         andcc  %o1, 3, %o5     /* is src word aligned  */

Where it should be a 'bleu' due the buffer length being a size_t.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2024-01-18 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 15:28 adhemerval.zanella at linaro dot org [this message]
2024-01-19  5:29 ` [Bug string/31266] " sam at gentoo dot org
2024-01-22 13:02 ` adhemerval.zanella at linaro dot org

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=bug-31266-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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).