https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68642
Bug ID: 68642 Summary: GCC crashes on deep std::make_index_sequence Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: wmhkebe at gmail dot com Target Milestone: --- Created attachment 36884 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36884&action=edit Preprocessed file that will crash the compiler. Compiling code containing std::make_index_sequence with moderately large N (~100k) will crash g++. This is illustrated by the following code snippet, which should be compiled with g++ -std=c++14 -ftemplate-depth=200000 (a preprocessed file is also attached): #include <utility> int main() { std::make_index_sequence<100000> a; return 0; } Compiler output: g++-5: internal compiler error: Segmentation fault: 11 (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <https://github.com/Homebrew/homebrew-versions/issues> for instructions. Output from g++ -v: Using built-in specs. COLLECT_GCC=gcc-5 COLLECT_LTO_WRAPPER=/Users/menghui/homebrew/Cellar/gcc5/5.2.0/libexec/gcc/x86_64-apple-darwin14.5.0/5.2.0/lto-wrapper Target: x86_64-apple-darwin14.5.0 Configured with: ../configure --build=x86_64-apple-darwin14.5.0 --prefix=/Users/menghui/homebrew/Cellar/gcc5/5.2.0 --libdir=/Users/menghui/homebrew/Cellar/gcc5/5.2.0/lib/gcc/5 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-5 --with-gmp=/Users/menghui/homebrew/opt/gmp --with-mpfr=/Users/menghui/homebrew/opt/mpfr --with-mpc=/Users/menghui/homebrew/opt/libmpc --with-isl=/Users/menghui/homebrew/opt/isl014 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc5 5.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib Thread model: posix gcc version 5.2.0 (Homebrew gcc5 5.2.0)