------- Comment #4 from ubizjak at gmail dot com 2009-01-01 17:35 ------- (In reply to comment #3)
> Most likely addsi3_carry should accept 0 as one of the operands. It does: (define_insn "addsi3_carry" [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0,0")) (match_operand:SI 2 "general_operand" "ri,rm"))) (clobber (reg:CC FLAGS_REG))] It looks to me that cprop_hardreg is the pass to handle this case, at least this sequence should be handled (to propagate cx): (insn 74 50 52 3 pr33717.c:12 (parallel [ (set (reg:SI 2 cx [+4 ]) (const_int 0 [0x0])) (clobber (reg:CC 17 flags)) ]) 45 {*movsi_xor} (nil)) (insn 53 52 54 3 pr33717.c:12 (parallel [ (set (reg:SI 4 si [+4 ]) (plus:SI (plus:SI (ltu:SI (reg:CC 17 flags) (const_int 0 [0x0])) (reg:SI 4 si [+4 ])) (reg:SI 2 cx [+4 ]))) (clobber (reg:CC 17 flags)) ]) 266 {addsi3_carry} (expr_list:REG_DEAD (reg:CC 17 flags) (expr_list:REG_DEAD (reg:SI 2 cx [+4 ]) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))))) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33717