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

            Bug ID: 87700
           Summary: [9 Regression] Compile time hog w/ -O1
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: compile-time-hog
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-9.0.0-alpha20181021 snapshot (r265361) takes indefinite time when compiling
the following snippet w/ -O1:

void
wn (int ki)
{
  int m8 = 0;
  int *d6 = &ki;

  if (ki == 0)
    {
 ud:
      for (ki = 0; ki < 1; ++ki)
        for (m8 = 0; m8 < 1; ++m8)
          goto ud;

      d6 = &m8;

 y8:
      ++m8;

 xw:
      if (ki == 0)
        {
        }
      else
        {
          for (m8 = 0; m8 < 1; ++m8)
            {
 gt:
              if (*d6 == 0)
                goto y8;
            }

          for (m8 = 0; m8 < 1; ++m8)
            {
              goto gt;

 ym:
              ;
            }
        }

      d6 = &ki;

      goto ym;
    }

  goto xw;
}

% timeout 10 gcc-9.0.0-alpha20181021 -O1 -c ehynqp9p.c
zsh: exit 124   timeout 10 gcc-9.0.0-alpha20181021 -O1 -c ehynqp9p.c

perf top:

Overhead  Sha  Symbol
  15.94%  cc1  [.] operand_equal_p
  14.86%  cc1  [.] inchash::add_expr
  12.49%  cc1  [.] add_ssa_edge
   8.54%  cc1  [.] copy_prop::visit_phi
   7.87%  cc1  [.] ssa_propagation_engine::simulate_stmt
   6.65%  cc1  [.] iterative_hash
   6.41%  cc1  [.] ssa_propagation_engine::ssa_propagate
   6.05%  cc1  [.] bitmap_set_bit
   4.07%  cc1  [.] useless_type_conversion_p
   3.71%  cc1  [.] iterative_hash_host_wide_int
   2.68%  cc1  [.] may_propagate_copy
   2.68%  cc1  [.] bitmap_clear_bit
   2.51%  cc1  [.] tree_operand_check
   2.42%  cc1  [.] bitmap_first_set_bit
   1.91%  cc1  [.] tree_strip_nop_conversions
   0.89%  cc1  [.] element_precision
   0.31%  cc1  [.] commutative_tree_code

Reply via email to