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

            Bug ID: 82320
           Summary: [8 Regression] Compile time hog w/ -O
           Product: gcc
           Version: 8.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-8.0.0-alpha20170917 snapshot (r252896) takes indefinite time when compiling
the following snippet w/ any optimization level except -O0:

void
ec (int n4, short int ea)
{
  if (1)
    {
      if (ea != 0)
        {
          int *c1 = (int *)&ea;

 nn:
          for (;;)
            ++*c1;
        }
    }
  else
    {
      int *lq = &n4;
      int *md;
      int da;

      goto nn;

 r1:
      md = lq;
      for (da = 0; da < 1; ++da)
        {
 ig:
          ++n4;
          *md += n4;
        }
    }

  for (ea = 0; ea < 1; ++ea)
    goto r1;

  goto ig;
}

% timeout 10 gcc-8.0.0-alpha20170924 -O1 -c yz3jwezs.c
zsh: exit 124   timeout 10 gcc-8.0.0-alpha20170924 -O1 -c yz3jwezs.c

perf top shows the following:

  24.40%  cc1       [.] visit_use
  22.59%  cc1       [.] operand_equal_p
   9.84%  cc1       [.] VN_INFO
   9.53%  cc1       [.] set_ssa_val_to
   8.75%  cc1       [.] DFS
   7.36%  cc1       [.] ssa_defined_default_def_p
   4.13%  cc1       [.] mark_use_processed
   3.70%  cc1       [.] ssa_undefined_value_p
   2.22%  cc1       [.] element_precision
   1.80%  cc1       [.] tree_strip_nop_conversions
   1.71%  cc1       [.] is_gimple_min_invariant
   1.35%  cc1       [.] _obstack_begin_worker
   0.76%  cc1       [.] _obstack_free
   0.63%  cc1       [.] mempool_obstack_chunk_free
   0.58%  cc1       [.] _obstack_begin
   0.23%  cc1       [.] mempool_obstack_chunk_alloc
   0.22%  cc1       [.] call_freefun
   0.17%  cc1       [.] call_chunkfun

Reply via email to