Bug 87776 - [9 Regression] Compile time hog during RPO VN
Summary: [9 Regression] Compile time hog during RPO VN
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Richard Biener
URL:
Keywords: compile-time-hog
Depends on:
Blocks:
 
Reported: 2018-10-28 04:56 UTC by Arseny Solokha
Modified: 2018-11-02 09:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 9.0
Last reconfirmed: 2018-10-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2018-10-28 04:56:59 UTC
gcc-9.0.0-alpha20181021 snapshot (r265361) takes indefinite time to compile the following snippet w/ -O2 (-O3, -Ofast, -Os) --param rpo-vn-max-loop-depth=2:

int wp;

void
ff (void)
{
  int *s3 = ℘

  for (wp = 0; wp < 1; ++wp)
    {
      if (wp != 0)
        {
 o8:
          ;
        }
      else
        {
 b7:
          while (wp < 1)
            {
            }
        }

      for (*s3 = 0; *s3 < 1; ++*s3)
        {
          for (wp = 0; wp < 1; ++wp)
            for (wp = 0; wp < 1; ++wp)
              {
              }

          for (wp = 0; wp < 1; ++wp)
            goto o8;

          for (wp = 0; wp < 1; ++wp)
            goto b7;
        }
    }
}

% timeout 10 gcc-9.0.0-alpha20181021 -O2 --param rpo-vn-max-loop-depth=2 -c uppnycas.c
zsh: exit 124   timeout 10 gcc-9.0.0-alpha20181021 -O2 --param rpo-vn-max-loop-depth=2 -c

Or is it something to expect w/ such a small argument for rpo-vn-max-loop-depth?
Comment 1 Martin Liška 2018-10-29 08:02:12 UTC
Confirmed, started to be slow with r264241.
Comment 2 Richard Biener 2018-10-31 12:23:09 UTC
Mine, somehow missed this.
Comment 3 Richard Biener 2018-11-02 07:54:19 UTC
Author: rguenth
Date: Fri Nov  2 07:53:48 2018
New Revision: 265739

URL: https://gcc.gnu.org/viewcvs?rev=265739&root=gcc&view=rev
Log:
2018-11-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87776
	* tree-ssa-sccvn.c (do_rpo_vn): Do not mark backedges
	executable when iterating but running into rpo-vn-max-loop-depth
	and not eliding the iteration.

	* gcc.dg/torture/pr87776.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr87776.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c
Comment 4 Richard Biener 2018-11-02 09:02:48 UTC
Fixed.