public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sebastian.huber@embedded-brains.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/50106] [ARM] Wrong code with -march=armv5t -mthumb -Os
Date: Mon, 22 Aug 2011 10:00:00 -0000	[thread overview]
Message-ID: <bug-50106-4-gEulrq3G6N@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50106-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50106

--- Comment #4 from Sebastian Huber <sebastian.huber@embedded-brains.de> 2011-08-22 09:43:39 UTC ---
Yes, this patch fixes the problem.

It is still not clear to me why we save the volatile registers r0, r1, and r2
at all.  Also we restore r1, r2, and r3.  Does this make sense?  I think also
the the usage of memcpy() is not justified in this case.

_Z7_GetIDSj:
        .fnstart
.LFB0:
        .save   {r0, r1, r2, lr}
        push    {r0, r1, r2, lr}
        ldr     r1, .L4
        cmp     r0, #3
        bhi     .L2
        lsl     r0, r0, #1
        add     r1, r1, r0
.L2:
        mov     r2, #2
        add     r0, sp, #4
        bl      memcpy
        add     r3, sp, #4
        ldrb    r0, [r3, #1]
        ldrb    r2, [r3]
        lsl     r0, r0, #8
        orr     r0, r2
        @ sp needed for prologue
        pop     {r1, r2, r3, pc}


  parent reply	other threads:[~2011-08-22  9:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17  8:53 [Bug target/50106] New: " sebastian.huber@embedded-brains.de
2011-08-17  8:55 ` [Bug target/50106] " sebastian.huber@embedded-brains.de
2011-08-17  9:07 ` sebastian.huber@embedded-brains.de
2011-08-17 17:23 ` ramana at gcc dot gnu.org
2011-08-22 10:00 ` sebastian.huber@embedded-brains.de [this message]
2011-09-12  9:34 ` sebastian.huber@embedded-brains.de
2011-10-18 14:20 ` sebastian.huber@embedded-brains.de
2011-10-18 14:58 ` ramana at gcc dot gnu.org
2011-10-20  9:09 ` ramana at gcc dot gnu.org
2011-10-20  9:24 ` ramana at gcc dot gnu.org
2011-10-20  9:25 ` ramana at gcc dot gnu.org
2011-10-20 11:07 ` sebastian.huber@embedded-brains.de
2012-06-12  2:50 ` amker at gcc dot gnu.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-50106-4-gEulrq3G6N@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).