https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69251
Bug ID: 69251 Summary: [6 Regression] ICE (segmentation fault) in unify_array_domain on i686-linux-gnu Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: doko at gcc dot gnu.org Target Milestone: --- trunk r232188, i686-linux-gnu, works with -O0 reduced test case: template <typename, typename = int> class A; struct B { int len; char name[]; }; template <class> struct C; template <typename> struct D; template <typename T, int N> struct D<T[N]>; template <class T> struct F { typename D<T>::type type; }; template <class> struct G; class H { template <class Source> H(Source &, typename C<G<typename F<Source>::type>>::type = 0); }; template <class Char, class Traits> void operator<<(A<Char, Traits>, H); class ErrnoLogMessage { public: A<char> &stream(); }; B *inotify_handler_ievent { ErrnoLogMessage().stream() << inotify_handler_ievent->name $ g++ -c -O server.ii server.ii: In instantiation of 'struct F<char []>': server.ii:21:55: recursively required by substitution of 'template<class Char, class Traits> void operator<<(A<Char, Traits>, H) [with Char = char; Traits = int]' server.ii:21:55: required from here server.ii:9:51: internal compiler error: Segmentation fault template <class T> struct F { typename D<T>::type type; }; ^~~~ 0x86c037a crash_signal ../../src/gcc/toplev.c:334 0x8225d7d unify_array_domain ../../src/gcc/cp/pt.c:19106 0x8224a80 unify ../../src/gcc/cp/pt.c:19662 0x8224f32 unify ../../src/gcc/cp/pt.c:19739 0x8225b4d get_partial_spec_bindings ../../src/gcc/cp/pt.c:20499 0x82229ae most_specialized_partial_spec ../../src/gcc/cp/pt.c:20771 0x822c400 instantiate_class_template_1 ../../src/gcc/cp/pt.c:9713 0x822c400 instantiate_class_template(tree_node*) ../../src/gcc/cp/pt.c:10283 0x8292b3b complete_type(tree_node*) ../../src/gcc/cp/typeck.c:131 0x821b11d tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:13328 0x8214da1 tsubst_decl ../../src/gcc/cp/pt.c:12014 0x821afb6 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:12697 0x822c63b instantiate_class_template_1 ../../src/gcc/cp/pt.c:9997 0x822c63b instantiate_class_template(tree_node*) ../../src/gcc/cp/pt.c:10283 0x8292b3b complete_type(tree_node*) ../../src/gcc/cp/typeck.c:131 0x821b11d tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:13328 0x821bbdb tsubst_template_arg ../../src/gcc/cp/pt.c:10296 0x82220c2 tsubst_template_args ../../src/gcc/cp/pt.c:11110 0x82225a5 tsubst_aggr_type ../../src/gcc/cp/pt.c:11307 0x821ac48 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:12776 Please submit a full bug report, with preprocessed source if appropriate.