This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/19598] New: [arm] non-optimal handling of invalid immediate constant in XOR


This function:

int f(int x)
{
  return x ^ 0x1234;
}

currently compiles (with -mtune=xscale) to:

        mov     r3, #4608
        add     r3, r3, #52
        eor     r0, r0, r3
        @ lr needed for prologue
        mov     pc, lr

or (with -mtune=arm9) to:

        ldr     r3, .L3
        @ lr needed for prologue
        eor     r0, r0, r3
        mov     pc, lr
.L4:
        .align  2
.L3:
        .word   4660

But, in both cases, it could be better done as:

        eor     r0, r0, #4608
        eor     r0, r0, #52
        mov     pc, lr

-- 
           Summary: [arm] non-optimal handling of invalid immediate constant
                    in XOR
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pb at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-linux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]