------- Additional Comments From amodra at bigpond dot net dot au 2004-11-24 07:00 ------- I believe this problem is caused by rs6000_rtx_costs. The two following insns are successfully combined:
(insn 20 19 21 0 (set (reg:DI 126) (eq:DI (reg:CCFP 125) (const_int 0 [0x0]))) 410 {*rs6000.md:11408} (insn_list:REG_DEP_TRUE 19 (nil)) (expr_list:REG_DEAD (reg:CCFP 125) (nil))) (insn 21 20 22 0 (set (reg:SI 124) (subreg:SI (reg:DI 126) 4)) 280 {*movsi_internal1} (insn_list:REG_DEP_TRUE 20 (nil)) (expr_list:REG_DEAD (reg:DI 126) (nil))) to (insn 21 20 22 0 (set (reg:SI 124) (eq:SI (reg:CCFP 125) (const_int 0 [0x0]))) 409 {*rs6000.md:11376} (insn_list:REG_DEP_TRUE 20 (nil)) (expr_list:REG_DEAD (reg:DI 126) (nil))) Following that, the new insn 21 and (insn 22 21 23 0 (set (reg:DI 121) (zero_extend:DI (reg:SI 124))) 24 {*rs6000.md:379} (insn_list:REG_DEP_TRUE 21 (nil)) (expr_list:REG_DEAD (reg:SI 124) (nil))) is a combine candidate, with a good result pattern of (set (reg:DI 121) (eq:DI (reg:CCFP 125) (const_int 0 [0x0]))) However, rs6000_rtx_costs decides this patten is more expensive than the previous two instructions. rejecting combination of insns 21 and 22 original costs 12 + 4 = 16 replacement cost 20 Code in question is as follows. I don't understand why these particular comparisons have been singled out, or why the mode == Pmode test. This contributes 12 case EQ: case GTU: case LTU: if (mode == Pmode) { switch (outer_code) { case SET: *total = COSTS_N_INSNS (3); break; The (const_int 0) contributes 8! This is because outer_code is EQ, which doesn't match anything in the rather long set of outer_code tests for CONST_INT. An obvious fix is to handle EQ and other comparisons here. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |dje at gcc dot gnu dot org Last reconfirmed|2004-08-02 01:02:22 |2004-11-24 07:00:16 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16800