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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That REG_UNUSED note on r1 looks weird.
In postreload_jump we have:
(insn 49 11 50 3 (set (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (const_int 0 [0])) "pr89826.c":9:14 181 {*arm_movsi_insn}
     (expr_list:REG_EQUAL (const_int 0 [0])
        (nil)))
(insn 50 49 12 3 (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
        (const_int 0 [0])) "pr89826.c":9:14 181 {*arm_movsi_insn}
     (expr_list:REG_EQUAL (const_int 0 [0])
        (nil)))
(insn 12 50 13 3 (set (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (not:SI (reg:SI 2 r2 [orig:124 a.0_1 ] [124]))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
(insn 13 12 37 3 (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
        (not:SI (reg:SI 12 ip [orig:125 a.0_1+4 ] [125]))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
which looks normal, but contains non-DCEd code (that was there since subreg
pass
that lowered:
(insn 35 11 12 3 (set (reg:DI 114 [ iftmp.1_5 ])
        (const_int 0 [0])) "pr89826.c":9:14 -1
     (nil))
(insn 12 35 13 3 (set (subreg:SI (reg:DI 114 [ iftmp.1_5 ]) 0)
        (not:SI (subreg:SI (reg:DI 110 [ a.0_1 ]) 0))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
(insn 13 12 37 3 (set (subreg:SI (reg:DI 114 [ iftmp.1_5 ]) 4)
        (not:SI (subreg:SI (reg:DI 110 [ a.0_1 ]) 4))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
).
In jump2 we have:
(insn 50 49 12 3 (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
        (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])) "pr89826.c":9:14 181
{*arm_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (expr_list:REG_UNUSED (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
            (expr_list:REG_EQUAL (const_int 0 [0])
                (nil)))))
(insn 12 50 13 3 (set (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (not:SI (reg:SI 2 r2 [orig:124 a.0_1 ] [124]))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
(insn 13 12 37 3 (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
        (not:SI (reg:SI 12 ip [orig:125 a.0_1+4 ] [125]))) "pr89826.c":9:14 156
{*arm_one_cmplsi2}
     (nil))
that still has the dead code in there and makes through REG_UNUSED clear it is
unused.
But then ce3 turns it into:
(insn 49 9 50 2 (set (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (const_int 0 [0])) "pr89826.c":9:14 181 {*arm_movsi_insn}
     (nil))
(insn 50 49 12 2 (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
        (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])) "pr89826.c":9:14 181
{*arm_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
        (expr_list:REG_UNUSED (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
            (nil))))
(insn 12 50 13 2 (cond_exec (eq (reg:CC 100 cc)
            (const_int 0 [0]))
        (set (reg:SI 3 r3 [orig:126 iftmp.1_5 ] [126])
            (not:SI (reg:SI 2 r2 [orig:124 a.0_1 ] [124])))) "pr89826.c":9:14
3805 {*p *arm_one_cmplsi2}
     (nil))
(insn 13 12 39 2 (cond_exec (eq (reg:CC 100 cc)
            (const_int 0 [0]))
        (set (reg:SI 1 r1 [orig:127 iftmp.1_5+4 ] [127])
            (not:SI (reg:SI 12 ip [orig:125 a.0_1+4 ] [125]))))
"pr89826.c":9:14 3805 {*p *arm_one_cmplsi2}
     (nil))
So, if the problem is using REG_UNUSED note, something forgot to recompute the
notes problem (regcprop?).

Reply via email to