This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68399] New: c++11 default initialization of a large array: slow compile


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

            Bug ID: 68399
           Summary: c++11 default initialization of a large array: slow
                    compile
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kcc at gcc dot gnu.org
  Target Milestone: ---

Reproducible with 4.8.2 and fresh trunk (r230509). 

% gcc -O1 z.cpp -std=c++11 -c


#ifndef SZ
# define SZ 16
#endif
struct Range {
  short B, E;
  Range() : B(0), E(0) {}
};
struct ArrayOfRanges {
  Range LabelRanges[1 << SZ] = {};
};
ArrayOfRanges *AOR = new ArrayOfRanges();


This code will take ~10 minutes to compile at -O1
The larger the SZ is the longer it takes.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]