------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2005-08-03 18:21 ------- These insns in the .32.flow2 RTL dump: (insn:HI 12 7 14 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3144 [0xc48])) [7 <variable>.selection_count+0 S4 A32]) (const_int 0 [0x0])) 34 {*movsi_1} (insn_list:REG_DEP_TRUE 6 (nil)) (nil))
(insn:HI 14 12 15 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3124 [0xc34])) [7 <variable>.startHCol+0 S4 A32]) (const_int 0 [0x0])) 34 {*movsi_1} (nil) (nil)) (insn:HI 15 14 17 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3120 [0xc30])) [7 <variable>.startHRow+0 S4 A32]) (const_int 0 [0x0])) 34 {*movsi_1} (nil) (nil)) [snip] are transformed by this peephole2: (define_peephole2 [(match_scratch:SI 1 "r") (set (match_operand:SI 0 "memory_operand" "") (const_int 0))] "! optimize_size && ! TARGET_USE_MOV0 && TARGET_SPLIT_LONG_MOVES && get_attr_length (insn) >= ix86_cost->large_insn && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 1) (const_int 0)) (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 1))] "") into: (insn 46 45 43 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3144 [0xc48])) [7 <variable>.selection_count+0 S4 A32]) (reg:SI 1 dx)) -1 (nil) (expr_list:REG_DEAD (reg:SI 1 dx) (nil))) (insn 43 46 44 0 (parallel [ (set (reg:SI 2 cx) (const_int 0 [0x0])) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) (insn 44 43 41 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3124 [0xc34])) [7 <variable>.startHCol+0 S4 A32]) (reg:SI 2 cx)) -1 (nil) (expr_list:REG_DEAD (reg:SI 2 cx) (nil))) (insn 41 44 42 0 (parallel [ (set (reg:SI 1 dx) (const_int 0 [0x0])) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) (insn 42 41 39 0 (set (mem/s:SI (plus:SI (reg/v/f:SI 0 ax [orig:58 screen ] [58]) (const_int 3120 [0xc30])) [7 <variable>.startHRow+0 S4 A32]) (reg:SI 1 dx)) -1 (nil) (expr_list:REG_DEAD (reg:SI 1 dx) (nil))) (insn 39 42 40 0 (parallel [ (set (reg:SI 2 cx) (const_int 0 [0x0])) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) [snip] Can the result of a peephole2 be used in matching another peephole2? If yes in that case another peephole2 can be written to match (set REGXXX 0) ;; this is generated by a previous peephole2 (set (mem.... ) (const_int 0)) and change that to (set (mem ....) REGXXXX) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23102