[llvm-bugs] [Bug 37531] New: Extreme compilation time degradation withof array of structs

via llvm-bugs llvm-bugs at lists.llvm.org
Sat May 19 04:35:15 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37531

            Bug ID: 37531
           Summary: Extreme compilation time degradation withof array of
                    structs
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: regression, slow-compile
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: v.reichelt at netcologne.de
                CC: llvm-bugs at lists.llvm.org

The following code snippet takes more than 2 minutes to compile
with just "-O" enabled:

===========================================================
struct A {};

struct S
{
  void foo();
  S(int, const A& = A()) { foo(); }
  ~S();
};

struct X
{
  S s1, s2, s3, s4, s5;
};

// helper macros for one, ten and fifty initializers for X
#define ONE { 0, 0, 0, 0, 0 },
#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
#define FIFTY TEN TEN TEN TEN TEN

static const X x[] = {
  FIFTY
  FIFTY
  FIFTY
  FIFTY
  FIFTY
  FIFTY
};
===========================================================

There seems to be some exponential compile time growth,
because the time almost doubles for every 50 additional
initializers:

  50:    1s
 100:    5s
 150:   17s
 200:   41s
 250:   81s
 300:  145s
 350:  230s

This is a very recent regression on the trunk (appeared within
the last week or so). Previous versions (including 6.0.0)
compile the code in less than 3 seconds.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180519/0c49a7ac/attachment.html>


More information about the llvm-bugs mailing list