http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58672
Bug ID: 58672 Summary: ICE with thread_local and variable of broken class Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet (compiled with "-std=c++11") triggers an ICE since GCC 4.8.0 (when thread_local was introduced): ========================== struct A { A(int); i; }; thread_local A a(0); ========================== bug.cc:4:3: error: 'i' does not name a type i; ^ bug.cc: In function 'void __tls_init()': bug.cc:7:16: internal compiler error: Segmentation fault thread_local A a(0); ^ 0xaefa5f crash_signal ../../gcc/gcc/toplev.c:335 0x7fa439 cgraph_create_function_alias(tree_node*, tree_node*) ../../gcc/gcc/cgraph.c:565 0x7fa51c cgraph_same_body_alias(cgraph_node*, tree_node*, tree_node*) ../../gcc/gcc/cgraph.c:594 0x617d7b handle_tls_init ../../gcc/gcc/cp/decl2.c:3976 0x617d7b cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4171 Please submit a full bug report, [etc.]