Hi, It seems we have had a bug for some time that causes an ICE and prevents the MIPS16 library builds from completing but is likely unrelated to MIPS16. The problem is when we call target_reinit and library functions get created as shown in the call stack at the end of this message. The first builtin that triggers the problem happens to be one of the MIPS16 helpers but I don't think there is anything unique about it. The issue appeared after some refactoring work in r253600 where code testing DECL_CLASS_SCOPE_P and DECL_FRIEND_P was previously guarded by a check for DECL_LANG_SPECIFIC but not after.
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00604.html I don’t know if this is the correct solution or whether we need to change the way builtins are initialised in the MIPS backend but I suspect this fix is the right way to go. Cc: Jason as author of the original change. Thanks, Matthew gcc/cp/ * pt.c (type_dependent_expression_p): Add missing check for DECL_LANG_SPECIFIC. --- gcc/cp/pt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 7345119..c88304f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -24635,6 +24635,7 @@ type_dependent_expression_p (tree expression) type-dependent. Checking this is important for functions with auto return type, which looks like a dependent type. */ if (TREE_CODE (expression) == FUNCTION_DECL + && DECL_LANG_SPECIFIC (expression) && !(DECL_CLASS_SCOPE_P (expression) && dependent_type_p (DECL_CONTEXT (expression))) && !(DECL_FRIEND_P (expression) -- 2.2.1 ...v3/include/bits/cpp_type_traits.h:408:32: internal compiler error: Segmentation fault __miter_base(_Iterator __it) ^ 0xd77fff crash_signal /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:326 0xd77fff crash_signal /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:326 0x74aeb9 type_dependent_expression_p(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/pt.c:24293 0x6cda47 mangle_decl_string /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3740 0x6cdca8 get_mangled_id /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3782 0x6cdf50 mangle_decl(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3820 0x74aeb9 type_dependent_expression_p(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/pt.c:24293 0x6cda47 mangle_decl_string /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3740 0x6cdca8 get_mangled_id /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3782 0x6cdf50 mangle_decl(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/mangle.c:3820 0x105af90 decl_assembler_name(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/tree.c:673 0xc7d1e8 build_libfunc_function(char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:736 0xc7d717 init_one_libfunc(char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:766 0xc7d79a set_optab_libfunc(optab_tag, machine_mode, char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:804 0x105af90 decl_assembler_name(tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/tree.c:673 0xc7d1e8 build_libfunc_function(char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:736 0xc7d717 init_one_libfunc(char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:766 0xc7d79a set_optab_libfunc(optab_tag, machine_mode, char const*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/optabs-libfuncs.c:804 0x10d49bb mips_init_libfuncs /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/config/mips/mips.c:13425 0xd7836c lang_dependent_init_target /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:1758 0xd7941c target_reinit() /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:1880 0x13e6f55 save_target_globals() /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/target-globals.c:86 0x10e0124 mips_set_compression_mode /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/config/mips/mips.c:19518 0xa7ee1b invoke_set_current_function_hook /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4783 0xa88aa7 invoke_set_current_function_hook /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4918 0xa88aa7 allocate_struct_function(tree_node*, bool) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4893 0x10d49bb mips_init_libfuncs /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/config/mips/mips.c:13425 0xd7836c lang_dependent_init_target /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:1758 0xd7941c target_reinit() /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/toplev.c:1880 0x13e6f55 save_target_globals() /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/target-globals.c:86 0x10e0124 mips_set_compression_mode /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/config/mips/mips.c:19518 0xa7ee1b invoke_set_current_function_hook /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4783 0xa88aa7 invoke_set_current_function_hook /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4918 0xa88aa7 allocate_struct_function(tree_node*, bool) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/function.c:4893 0x650ab7 start_preparsed_function(tree_node*, tree_node*, int) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/decl.c:14941 0x670fb6 start_function(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/decl.c:15155 0x650ab7 start_preparsed_function(tree_node*, tree_node*, int) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/decl.c:14941 0x670fb6 start_function(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/decl.c:15155 0x72b364 cp_parser_function_definition_from_specifiers_and_declarator /scratch/mpf/overtest/64126/240294/shared/gcc/gcc/cp/parser.c:26492 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See < /> for instructions. make[8]: *** [mips-mti-elf/bits/stdc++.h.gch/O2ggnu++0x.gch] Error