public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53988] New: [SH] tst Rm,Rn not used for QI/HImode
@ 2012-07-17  0:02 olegendo at gcc dot gnu.org
  2012-09-03 10:02 ` [Bug target/53988] " olegendo at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-07-17  0:02 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53988
           Summary: [SH] tst Rm,Rn not used for QI/HImode
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olegendo@gcc.gnu.org
            Target: sh*-*-*


The following functions:

int test_00 (unsigned char* a, unsigned char* b, int c, int d)
{
  if (*a & *b)
    return c;
  return d;
}

int test_01 (char* a, char* b, int c, int d)
{
  if (*a & *b)
    return c;
  return d;
}

get compiled to:
        mov.b   @r4,r1  ! 10    *extendqisi2_compact_snd
        mov.b   @r5,r0  ! 11    *extendqisi2_compact_snd
        and     r1,r0   ! 12    *andsi_compact/4
        tst     #255,r0 ! 15    tstqi_t_zero
        bf      .L9     ! 16    branch_false
        mov     r7,r6   ! 7    movsi_ie/2
.L9:
        rts             ! 49    *return_i
        mov     r6,r0   ! 24    movsi_ie/2


which should actually result in:
        mov.b   @r4,r1
        mov.b   @r5,r2
        tst     r1,r2
        bf      .L9
        mov     r7,r6
.L9:
        rts
        mov     r6,r0

The same happens for QImode and HImode.


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

end of thread, other threads:[~2015-03-10  8:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17  0:02 [Bug target/53988] New: [SH] tst Rm,Rn not used for QI/HImode olegendo at gcc dot gnu.org
2012-09-03 10:02 ` [Bug target/53988] " olegendo at gcc dot gnu.org
2012-10-31 22:09 ` olegendo at gcc dot gnu.org
2012-11-05 21:11 ` olegendo at gcc dot gnu.org
2014-12-29 19:03 ` olegendo at gcc dot gnu.org
2015-01-14 23:47 ` olegendo at gcc dot gnu.org
2015-01-19 22:36 ` olegendo at gcc dot gnu.org
2015-03-10  8:10 ` olegendo at gcc dot gnu.org
2015-03-10  8:18 ` olegendo at gcc dot gnu.org
2015-03-10  8:19 ` 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).