Description of problem: internal compiler error: Segmentation fault (program cc1plus) Version-Release number of selected component (if applicable): gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) How reproducible: Always Steps to Reproduce: g++ bug.cpp Actual results: Segmentation fault Expected results: In this case, a valid error message. There may be other programs which are correct code and segfault like this - in which case, success would be expected.
Created attachment 903155 [details] bug.cpp
The stack trace appears to be infinite recursion in: walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*)) () (The start of the stack is inaccessible in gdb, as gdb requires many gigabytes of memory to process it.)
Created attachment 907682 [details] bug-expects-success.cpp I was able to construct a file where successful compilation is expected, but it still segfaults in the same way as the original file. The stack trace looks the same at the end, so presumably it's the same underlying bug. `gcc -c bug-expects-success.cpp` will succeed if you lower the "200" number(s) inside the file.
I've filed it upstream as http://gcc.gnu.org/PR61592 , for the time being the answer is just don't do something so silly, i.e. don't use non-POD types in very large arrays.