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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|jakub at gcc dot gnu.org           |unassigned at gcc dot 
gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, create_log_links wants to work like that.
So, the bug seems to be that insn 108 has REG_DEAD (reg:CC 17 flags) note.
It doesn't initially, but it is added during 106 -> 108 combination
(gdb) p debug_rtx (i3)
(insn 108 107 111 6 (set (reg:QI 96 [ var_lsm_flag.12 ])
        (if_then_else:QI (eq (reg:CCZ 17 flags)
                (const_int 0 [0]))
            (reg:QI 134)
            (reg:QI 135))) "pr99927.c":13:24 1104 {*movqicc_noc}
     (expr_list:REG_DEAD (reg:QI 134)
        (nil)))
$151 = void
(gdb) p debug_rtx (i2)
(insn 106 105 107 6 (parallel [
            (set (reg:QI 134)
                (and:QI (subreg:QI (reg:SI 107) 0)
                    (const_int 1 [0x1])))
            (clobber (reg:CC 17 flags))
        ]) "pr99927.c":13:24 491 {*andqi_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))

The combination of those 2 insns is successful - into:
(insn 108 107 111 6 (set (reg:QI 96 [ var_lsm_flag.12 ])
        (if_then_else:QI (eq (reg:CCZ 17 flags)
                (const_int 0 [0]))
            (subreg:QI (reg:SI 107) 0)
            (reg:QI 135))) "pr99927.c":13:24 1104 {*movqicc_noc}
     (expr_list:REG_DEAD (reg:SI 107)
        (expr_list:REG_DEAD (reg:CC 17 flags)
            (nil))))
but the distribute_notes that turned REG_UNUSED (reg:CC 17 flags) note from
insn 106 into REG_DEAD (reg:CC 17 flags) note on insn 108 is what looks broken
to me,
the flags register is set by insn 107 in between those two and is used by some
insns after insn 108 (111 and 85) and the new combined pattern certainly
doesn't
kill the register in any way.

Segher, could you please have a look?
Thanks.

Reply via email to