This is the mail archive of the gcc-help@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] | |
Dear GCC hackers,
Consider the following code (also attached with additional examples as
bug.c):
#include <array>
#include <list>
#define SIZE 1000000
int main() {
std::array< std::list< char >, SIZE > x{};
return 0;
}
When I run the command `time g++ -std=c++11 bug.c`, I get the following
output:
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
g++ -std=c++11 bug.c 47.52s user 2.95s system 99% cpu 50.586 total
As shown in the attached source file bug.c, this problem only seems to
occur when the element type is an STL container potentially allocating
on the heap, i.e. the following
std::array< std::array< char, 26 >, SIZE > x{};
compiles fine. Finally, the same code (using std::list) compiles fine
if I don't give any initialiser list at all.
My version of g++ is 5.4.0.
Is it a known g++ bug? I've vaguely seen people report similar issues
(I lost the link :-( ), but I couldn't quickly find anything on the bug
tracker.
Please keep me in CC as I am not subscribed to the list. Thank you!
--
Sergiu
Attachment:
bug.c
Description: Binary data
Attachment:
signature.asc
Description: PGP signature
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |