------- Comment #3 from steven at gcc dot gnu dot org 2010-03-31 15:15 ------- Well, according to GDB, combine does try to combine in try_combine: Breakpoint 8, try_combine (i3=0x20000000004fc8b8, i2=0x20000000004fc828, i1=0x0, new_direct_jump_p=0x60000fffffd4ae28) at ../../trunk/gcc/combine.c:2389 2389 rtx newpat, newi2pat = 0; 3: debug_rtx(i3) = (insn 9 8 10 2 t.c:8 (set (reg:CC 24 cc) (compare:CC (reg/v:SI 134 [ fD.1273 ]) (const_int 0 [0x0]))) 220 {*arm_cmpsi_insn} (nil)) void 2: debug_rtx(i2) = (insn 8 7 9 2 t.c:7 (set (reg/v:SI 134 [ fD.1273 ]) (reg:SI 0 r0)) 658 {*thumb2_movsi_insn} (expr_list:REG_DEAD (reg:SI 0 r0) (nil)))
But then we hit cant_combine_insn_p(i2) because r0 is LO_REGS, we're compiling for TARGET_THUMB, and so CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (src))) is true for src=r0 in this reg-reg move: if (REG_P (src) && REG_P (dest) && ((REGNO (src) < FIRST_PSEUDO_REGISTER && ! fixed_regs[REGNO (src)] && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (src)))) || (REGNO (dest) < FIRST_PSEUDO_REGISTER && ! fixed_regs[REGNO (dest)] && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (dest)))))) return 1; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43597