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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |compile-time-hog
          Component|c                           |rtl-optimization

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
stuck in RTL jump pass btw, calling delete_trivially_dead_insns at the start
of its invocation (_not_ during the jump threading iteration).

We have a block with very many DEBUG_INSN at end and delete_insn_and_edges
does

/* Like delete_insn but also purge dead edges from BB.
   Return true if any edges are eliminated.  */

bool
delete_insn_and_edges (rtx_insn *insn)
{
  bool purge = false;

  if (INSN_P (insn) && BLOCK_FOR_INSN (insn))
    {
      basic_block bb = BLOCK_FOR_INSN (insn);
      if (BB_END (bb) == insn)
        purge = true;
      else if (DEBUG_INSN_P (BB_END (bb)))
        for (rtx_insn *dinsn = NEXT_INSN (insn);
             DEBUG_INSN_P (dinsn); dinsn = NEXT_INSN (dinsn))
          if (BB_END (bb) == dinsn)
            {
              purge = true;
              break;
            }
    }
  delete_insn (insn);
  if (purge)
    return purge_dead_edges (BLOCK_FOR_INSN (insn));

that's highly inefficient when insn is a debug insn itself.  Fixing that
alone doesn't seem to be enough to make it "fast" but at least it
finishes in 20s for me then with no obvious peak.

Reply via email to