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

--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
Oh, we have this issue:

Trying 16, 22, 21 -> 23:
   16: r106:QI=flags:CCNO>0
   22: {r120:QI=r106:QI^0x1;clobber flags:CC;}
      REG_UNUSED flags:CC
   21: r119:QI=flags:CCNO<=0
      REG_DEAD flags:CCNO
   23: {r110:QI=r119:QI|r120:QI;clobber flags:CC;}
      REG_DEAD r120:QI
      REG_DEAD r119:QI
      REG_UNUSED flags:CC
Failed to match this instruction:
(parallel [
        (set (reg:QI 110 [ d_lsm_flag.20 ])
            (le:QI (reg:CCNO 17 flags)
                (const_int 0 [0])))
        (clobber (reg:CC 17 flags))
        (set (reg:QI 106 [ _37 ])
            (gt:QI (reg:CCNO 17 flags)
                (const_int 0 [0])))
    ])
Failed to match this instruction:
(parallel [
        (set (reg:QI 110 [ d_lsm_flag.20 ])
            (le:QI (reg:CCNO 17 flags)
                (const_int 0 [0])))
        (set (reg:QI 106 [ _37 ])
            (gt:QI (reg:CCNO 17 flags)
                (const_int 0 [0])))
    ])
Successfully matched this instruction:
(set (reg:QI 106 [ _37 ])
    (gt:QI (reg:CCNO 17 flags)
        (const_int 0 [0])))
Successfully matched this instruction:
(set (reg:QI 110 [ d_lsm_flag.20 ])
    (le:QI (reg:CCNO 17 flags)
        (const_int 0 [0])))
allowing combination of insns 16, 21, 22 and 23
original costs 4 + 4 + 4 + 4 = 16
replacement costs 4 + 4 = 8
deferring deletion of insn with uid = 21.
deferring deletion of insn with uid = 16.
modifying insn i2    22: r106:QI=flags:CCNO>0
      REG_DEAD flags:CC                            <----- NOPE!
deferring rescan insn with uid = 22.
modifying insn i3    23: r110:QI=flags:CCNO<=0
      REG_DEAD flags:CC
deferring rescan insn with uid = 23.

Followed by:

Trying 15 -> 22:
   15: flags:CCNO=cmp(r115:SI,0)
      REG_DEAD r115:SI
   22: r106:QI=flags:CCNO>0
      REG_DEAD flags:CC
Successfully matched this instruction:
(set (reg:QI 106 [ _37 ])
    (subreg:QI (reg:SI 115 [ _1 ]) 0))
allowing combination of insns 15 and 22
original costs 4 + 4 = 8
replacement cost 4
deferring deletion of insn with uid = 15.
modifying insn i3    22: r106:QI=r115:SI#0
      REG_DEAD r115:SI
deferring rescan insn with uid = 22.

Well ... flags reg is *not* dead at (insn 22), it is also needed at (insn 23),
so the above combination that removes flags reg initialization at (insn 15) is
not allowed. The compilation goes downhill from there.

Reply via email to