[Bug target/59533] [SH] Missed cmp/pz opportunity

olegendo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 25 17:25:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59533

--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #5)

The same would apply to:

int test (unsigned char* x, int y, int z)
{
   return ((*x >> 7) ^ 0) & 1;
}

which compiles to

        mov.b   @r4,r1
        shll    r1
        rts
        movt    r0

on non-SH2A.  The insn selection goes like this:
   zero_extract -> tstsi_t -> cmp/pz -> shll-movt



More information about the Gcc-bugs mailing list