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

bin.cheng <amker.cheng at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |target

--- Comment #2 from bin.cheng <amker.cheng at gmail dot com> ---
This only happens on arm mode.
For below gimple,
  k_8 = parent[k_29];
On ARM mode GCC expands it into,
   81: r180:SI=0xf7f0
   82: zero_extract(r180:SI,0x10,0x10)=0xffff
   83: r181:SI=r165:SI<<0x2
   84: r182:SI=r105:SI+r181:SI
   85: r183:SI=r182:SI+r180:SI
   86: r165:SI=[r183:SI]
while on Thumb2 GCC expands it into,
   88: r185:SI=r105:SI
   89: r186:SI=r105:SI-0x810
   90: r171:SI=[r171:SI*0x4+r186:SI]
thus resulting in much better assembly code,
.L5:
    ldr    r3, [sp, r3, lsl #2]
    adds    r2, r2, #1
    cmp    r3, #0
    bge    .L5
    uxtb    r2, r2

Reply via email to