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

--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Note, before *.ira the pseudo 93 set by the movsicc is actually used by
> another insn, but that is removed early in the ira pass during
> delete_trivially_dead_insns.  But for some reason the if_then_else is not
> removed as trivially dead, and even if it would, nothing recomputes the lr
> problem (or is that live) that would adjust or reset the debug insns that
> are refering the pseudos that are not live anymore.

Jakub, you gave the right analysis.  Thanks.  We have the following code
situation (see below).  Although fixing delete_trivially_dead_insns
will not fix the problem, as the troubled debug insn 24 from block
different from one of insn 121 still will stay.  I am working on the
problem and hope to have a fix by Monday.


BB3:
  17: {r138:SI=r138:SI^r91:SI;clobber flags:CC;}
      REG_UNUSED flags:CC
    Inserting insn reload before:
  145: r138:SI=r90:SI
    Inserting insn reload after:
  146: r93:SI=r138:SI

18: debug_insn h=> 93

     Creating newreg=139 from oldreg=114, assigning class AREG to r139
   20: {r139:SI=udiv(r139:SI,r91:SI);r115:SI=umod(r139:SI,r91:SI);clobber
flags:CC;}
      REG_UNUSED r115:SI
      REG_UNUSED flags:CC
    Inserting insn reload before:
  147: r139:SI=r93:SI
    Inserting insn reload after:
  148: r114:SI=r139:SI

24: debug_insn h=> ...93

BB6:

      Creating newreg=142 from oldreg=135, assigning class GENERAL_REGS to r142
      Creating newreg=143 from oldreg=93, assigning class GENERAL_REGS to r143
      Making reload reg 143 for reg 93 optional
  121: r142:SI={(flags:CCZ==0)?r143:SI:r142:SI}
      REG_DEAD r135:SI
      REG_DEAD flags:CCZ
      REG_UNUSED r93:SI
      REG_EQUAL {(flags:CCZ==0)?r93:SI:0}
    Inserting insn reload before:
  152: r142:SI=r135:SI
  153: r143:SI=r93:SI
---
BB6:
   Insn 153: point = 25
   Deleting dead insn 153
  r93 is removed as live at bb6 start
---
BB3:
      Creating newreg=147 from oldreg=93, assigning class GENERAL_REGS to
inheritance r147
    Original reg change 93->147 (bb3):
  146: r147:SI=r138:SI
      REG_DEAD r138:SI
    Add original<-inheritance after:
  157: r93:SI=r147:SI

    Inheritance reuse change 93->147 (bb3):
   18: debug h => r147:SI
    Inheritance reuse change 93->147 (bb3):
  147: r139:SI=r147:SI
      REG_DEAD r147:SI

            Removing dead insn:
   157: r93:SI=r147:SI

Reply via email to