[Bug c++/68399] New: c++11 default initialization of a large array: slow compile
kcc at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 18 00:48:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list