https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119594

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The steps are in particular that the fwprop pass proper optimizes
(insn 26 24 27 7 (set (reg:DI 104 [ g ])
        (zero_extend:DI (subreg:SI (reg/v:DI 101 [ g ]) 0))) "pr119594.c":11:8
175 {*zero_extendsidi2}
     (expr_list:REG_DEAD (reg/v:DI 101 [ g ])
        (nil)))
(insn 27 26 28 7 (set (reg/v:DI 101 [ g ])
        (reg:DI 104 [ g ])) "pr119594.c":11:8 95 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 104 [ g ])
        (expr_list:REG_UNUSED (reg/v:DI 101 [ g ])
            (nil))))
into
(insn 26 24 27 7 (set (reg:DI 104 [ g ])
        (zero_extend:DI (subreg:SI (reg/v:DI 101 [ g ]) 0))) "pr119594.c":11:8
175 {*zero_extendsidi2}
     (expr_list:REG_EQUAL (const_int 4294967295 [0xffffffff])
        (expr_list:REG_DEAD (reg/v:DI 101 [ g ])
            (nil))))
(insn 27 26 28 7 (set (reg/v:DI 101 [ g ])
        (zero_extend:DI (subreg:SI (reg/v:DI 101 [ g ]) 0))) "pr119594.c":11:8
175 {*zero_extendsidi2}
     (expr_list:REG_EQUAL (const_int 4294967295 [0xffffffff])
        (expr_list:REG_UNUSED (reg/v:DI 101 [ g ])
            (nil))))
(i.e. replaces (reg:DI 104 [ g ]) in insn 27 with the SET_SRC of insn 26.
REG_DEAD/REG_UNUSED notes aren't updated, that generally isn't responsibility
of passes, passes that want to use those notes should df_note_add_problem and
df_analyze.

But then it calls delete_trivially_dead_insns and that subpass deletes insn 26
(that is ok) and insn 7 (not ok).  I don't see REG_DEAD note uses in there
though.

Reply via email to