https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85078
Bug ID: 85078 Summary: LTO ICE: tree check: expected tree that contains 'decl minimal' structure, have 'identifier_node' in decl_mangling_context, at cp/mangle.c:878 Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: sirl at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 43760 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43760&action=edit testcase The attached testcase ICEs with trunk@r258851. 7.3.1 compiles the testcase without problems. g++-8 -flto -c -O2 test-LTO-ICE.cpp during IPA pass: visibility test-LTO-ICE.cpp:20:8: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'identifier_node' in decl_mangling_context, at cp/mangle.c:878 void c (int, const char *, a &); ^ 0xa22890 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.c:9494 0x4b05dc contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.h:3249 0x4b05dc decl_mangling_context ../../gcc/cp/mangle.c:878 0x4b05dc write_name ../../gcc/cp/mangle.c:906 0xfd6cea write_class_enum_type ../../gcc/cp/mangle.c:2809 0xfd6cea write_type ../../gcc/cp/mangle.c:2222 0xfd743b write_array_type ../../gcc/cp/mangle.c:3600 0xfd743b write_type ../../gcc/cp/mangle.c:2146 0xfd6ea8 write_type ../../gcc/cp/mangle.c:2255 0xfd7de8 write_method_parms ../../gcc/cp/mangle.c:2796 0xfd2af4 write_bare_function_type ../../gcc/cp/mangle.c:2732 0xfd2af4 write_encoding ../../gcc/cp/mangle.c:847 0xfd220e write_mangled_name ../../gcc/cp/mangle.c:790 0xfd220e mangle_decl_string ../../gcc/cp/mangle.c:3792 0xfd1cd5 get_mangled_id ../../gcc/cp/mangle.c:3814 0xfd1cd5 mangle_decl(tree_node*) ../../gcc/cp/mangle.c:3852 0x1451e5d decl_assembler_name(tree_node*) ../../gcc/tree.c:687 0x10f55e0 symbol_table::insert_to_assembler_name_hash(symtab_node*, bool) ../../gcc/symtab.c:174 0x10f55e0 symtab_node::register_symbol() ../../gcc/symtab.c:386 0x10fd244 cgraph_node::create(tree_node*) ../../gcc/cgraph.c:520 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report.