public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/61142] New: [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0
@ 2014-05-10 21:27 olegendo at gcc dot gnu.org
  2014-05-10 21:28 ` [Bug target/61142] " olegendo at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-05-10 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61142
           Summary: [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn =
                    R0
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
            Target: sh*-*-*

I've noticed that @(R0,Rm),Rn loads won't load into Rn = R0.
Example:

int test0 (const char* x, int a, int b, int c)
{
  if (x[a] == 92)
    return b;
  return c;
}

With -O2 -m4 -ml compiles to:
        mov     r5,r0
        mov.b   @(r0,r4),r1  <<<<
        mov     r1,r0        <<<<
        cmp/eq  #92,r0
        bt      .L3
        mov     r7,r0
        rts
        nop
    .align 1
.L3:
        rts
        mov     r6,r0

This happens for QImode and HImode loads.  SImode is fine.

I'm not sure whether it's a side effect of the changes done for PR 50751, or
something else.

It could be worked around with a peephole, but then we'd waste one register.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-01 18:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-10 21:27 [Bug target/61142] New: [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0 olegendo at gcc dot gnu.org
2014-05-10 21:28 ` [Bug target/61142] " olegendo at gcc dot gnu.org
2014-09-12 17:16 ` olegendo at gcc dot gnu.org
2014-12-21 12:40 ` olegendo at gcc dot gnu.org
2015-02-22 22:30 ` olegendo at gcc dot gnu.org
2015-02-24 21:29 ` olegendo at gcc dot gnu.org
2015-02-26 20:22 ` olegendo at gcc dot gnu.org
2015-03-01 18:49 ` olegendo at gcc dot gnu.org

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).