https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90887
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> --- Still debugging. I add tons of 'printf' and the first difference which shows up is the following call: check_return_expr -> build_non_dependent_expr (with flag == 2) -> fold_non_dependent_expr -> fold_non_dependent_expr_template This call only happens with -g0 and not with -g3. (With -g0 there are 507 and with -g3 487 calls to check_return_expr.) However, as register_symbol-calling is not called, this is not the culprit for the symbol_order difference. The register_symbol-calling change for std::_PCC<<anonymous>, _T1, _T2>::_ConstructiblePair() goes via: #0 symtab_node::register_symbol (this=0x7fffeba9c168) at ../../gcc/symtab.c:379 #1 0x0000000000ba17b9 in cgraph_node::create(tree_node*) () at ../../gcc/cgraph.c:523 #2 0x0000000000ba15e1 in cgraph_node::get_create(tree_node*) () at ../../gcc/cgraph.c:545 #3 0x0000000000af8611 in c_genericize(tree_node*) () at ../../gcc/c-family/c-gimplify.c:152 #4 0x0000000000916ea8 in cp_genericize(tree_node*) () at ../../gcc/cp/cp-gimplify.c:1809 #5 0x0000000000952d82 in finish_function(bool) () at ../../gcc/cp/decl.c:16277 #6 0x0000000000a259a4 in instantiate_decl(tree_node*, bool, bool) () at ../../gcc/cp/pt.c:24810 #7 0x00000000008f8d21 in instantiate_cx_fn_r(tree_node**, int*, void*) () at ../../gcc/cp/constexpr.c:5301 #8 0x0000000001279e55 in walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) () at ../../gcc/tree.c:12151 #9 0x000000000127a736 in walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) () at ../../gcc/tree.h:3698 #10 0x000000000127d102 in walk_tree_without_duplicates_1 (tp=tp@entry=0x7fffffffbc18, func=func@entry=0x8f8af0 <instantiate_cx_fn_r(tree_node**, int*, void*)>, data=data@entry=0x0, lh=0xa7c8f0 <cp_walk_subtrees(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)>) at ../../gcc/tree.c:12502 #11 0x0000000000903a03 in instantiate_constexpr_fns (t=<optimized out>) at ../../gcc/cp/constexpr.c:5325 #12 cxx_eval_outermost_constant_expr(tree_node*, bool, bool, bool, tree_node*) () at ../../gcc/cp/constexpr.c:5397 #13 0x0000000000907f2a in fold_non_dependent_expr_template(tree_node*, int, bool) () at ../../gcc/cp/constexpr.c:5685 #14 0x000000000090804f in fold_non_dependent_expr (t=t@entry=0x7fffebaca810, complain=complain@entry=0, manifestly_const_eval=manifestly_const_eval@entry=false) at ../../gcc/cp/constexpr.c:5731 #15 0x0000000000a0616e in build_non_dependent_expr(tree_node*) () at ../../gcc/cp/pt.c:26665 #16 0x0000000000a927d2 in build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) () at ../../gcc/cp/typeck.c:4188 #17 0x0000000000a19937 in tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) [clone .part.0] () at ../../gcc/tree.h:3698 #18 0x0000000000a26358 in tsubst_copy_and_build (integral_constant_expression_p=true, function_p=false, in_decl=0x0, complain=0, args=<optimized out>, t=0x7fffeba65488) at ../../gcc/cp/pt.c:18261 #19 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) [clone .part.0] () at ../../gcc/cp/pt.c:17937 #20 0x0000000000a2c1d4 in tsubst_expr (integral_constant_expression_p=true, in_decl=<optimized out>, complain=<optimized out>, args=<optimized out>, t=<optimized out>) at ../../gcc/cp/pt.c:17029 #21 tsubst_template_arg (in_decl=<optimized out>, complain=<optimized out>, args=<optimized out>, t=<optimized out>) at ../../gcc/cp/pt.c:11554 #22 tsubst_template_arg (t=<optimized out>, args=<optimized out>, complain=<optimized out>, in_decl=<optimized out>) at ../../gcc/cp/pt.c:11542 #23 0x0000000000a33843 in tsubst_template_args(tree_node*, tree_node*, int, tree_node*) () at ../../gcc/cp/pt.c:12590 #24 0x0000000000a38067 in tsubst_aggr_type(tree_node*, tree_node*, int, tree_node*, int) () at ../../gcc/tree.h:3312 #25 0x0000000000a1fa1e in tsubst(tree_node*, tree_node*, int, tree_node*) () at ../../gcc/cp/pt.c:15032 #26 0x0000000000a46632 in type_unification_real(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, int, unification_kind_t, vec<deferred_access_check, va_gc, vl_embed>**, bool) () at ../../gcc/tree.h:3312 #27 0x0000000000a47139 in fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) () at ../../gcc/tree.h:3198 #28 0x00000000008cbd37 in add_template_candidate_real(z_candidate**, tree_node*, tree_node*, tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed> const*, tree_node*, tree_node*, tree_node*, int, tree_node*, unification_kind_t, int) () at ../../gcc/cp/call.c:3318 #29 0x00000000008cc6bd in add_template_candidate (complain=0, strict=DEDUCE_CALL, flags=1, conversion_path=0x7fffebd58208, access_path=0x7fffebd58208, return_type=0x0, arglist=<optimized out>, first_arg=<optimized out>, explicit_targs=0x0, ctype=0x7fffebd9e0a8, tmpl=<optimized out>, candidates=0x7fffffffc478) at ../../gcc/cp/call.c:5727 #30 add_candidates(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed> const*, tree_node*, tree_node*, bool, tree_node*, tree_node*, int, z_candidate**, int) [clone .part.0] () at ../../gcc/cp/call.c:5727 #31 0x00000000008d5b04 in add_candidates (complain=0, candidates=0x7fffffffc478, flags=1, access_path=<optimized out>, conversion_path=0x7fffebd58208, template_only=false, explicit_targs=0x0, return_type=<optimized out>, args=0x7fffebd3e2f8, first_arg=0x7fffebacb080, fns=0x7fffebaabb20) at ../../gcc/cp/call.c:9759 #32 build_new_method_call_1 (complain=0, fn_p=0x0, flags=1, conversion_path=0x7fffebd58208, args=0x7fffebacb080, fns=0x7fffebaabb20, instance=0x7fffebacb080) at ../../gcc/cp/call.c:9759 #33 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) () at ../../gcc/cp/call.c:9946 #34 0x00000000008d6c24 in build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) () at ../../gcc/tree.h:3238 #35 0x0000000000ab1f0f in build_functional_cast(tree_node*, tree_node*, int) () at ../../gcc/cp/cp-tree.h:892 #36 0x0000000000a1bea4 in tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) [clone .part.0] () at ../../gcc/cp/pt.c:18446 #37 0x0000000000a1e1e4 in tsubst_copy_and_build (integral_constant_expression_p=<optimized out>, function_p=<optimized out>, in_decl=<optimized out>, complain=<optimized out>, args=<optimized out>, t=<optimized out>) at ../../gcc/cp/pt.c:6015 #38 instantiate_non_dependent_expr_internal (expr=expr@entry=0x7fffebacb000, complain=complain@entry=0) at ../../gcc/cp/pt.c:6017 #39 0x0000000000a1e203 in instantiate_non_dependent_expr_internal (expr=expr@entry=0x7fffebacb000, complain=complain@entry=0) at ../../gcc/cp/pt.c:18261 #40 0x0000000000907e9c in fold_non_dependent_expr_template(tree_node*, int, bool) () at ../../gcc/cp/constexpr.c:5671 #41 0x000000000090804f in fold_non_dependent_expr (t=t@entry=0x7fffebacb000, complain=complain@entry=0, manifestly_const_eval=manifestly_const_eval@entry=false) at ../../gcc/cp/constexpr.c:5731 #42 0x0000000000a0616e in build_non_dependent_expr(tree_node*) () at ../../gcc/cp/pt.c:26665 #43 0x0000000000aa831d in check_return_expr(tree_node*, bool*) () at ../../gcc/cp/typeck.c:9828 #44 0x0000000000a5f710 in finish_return_stmt(tree_node*) () at ../../gcc/cp/semantics.c:902 #45 0x00000000009d9415 in cp_parser_jump_statement (parser=0x7ffff1924130) at ../../gcc/cp/parser.c:12909 #46 cp_parser_statement(cp_parser*, tree_node*, bool, bool*, vec<tree_node*, va_heap, vl_ptr>*, unsigned int*) () at ../../gcc/cp/parser.c:11182 #47 0x00000000009f4ec8 in cp_parser_implicitly_scoped_statement (parser=parser@entry=0x7ffff1924130, if_p=if_p@entry=0x0, guard_tinfo=..., chain=0x0) at ../../gcc/cp/parser.c:13023 #48 0x00000000009d955d in cp_parser_selection_statement (chain=<optimized out>, if_p=0x0, parser=0x7ffff1924130) at ../../gcc/cp/parser.c:11885 #49 cp_parser_statement(cp_parser*, tree_node*, bool, bool*, vec<tree_node*, va_heap, vl_ptr>*, unsigned int*) () at ../../gcc/cp/parser.c:11167 #50 0x00000000009f4ec8 in cp_parser_implicitly_scoped_statement (parser=parser@entry=0x7ffff1924130, if_p=if_p@entry=0x0, guard_tinfo=..., chain=0x0) at ../../gcc/cp/parser.c:13023 #51 0x00000000009d955d in cp_parser_selection_statement (chain=<optimized out>, if_p=0x0, parser=0x7ffff1924130) at ../../gcc/cp/parser.c:11885 #52 cp_parser_statement(cp_parser*, tree_node*, bool, bool*, vec<tree_node*, va_heap, vl_ptr>*, unsigned int*) () at ../../gcc/cp/parser.c:11167 #53 0x00000000009d9b39 in cp_parser_statement_seq_opt (parser=parser@entry=0x7ffff1924130, in_statement_expr=in_statement_expr@entry=0x0) at ../../gcc/cp/parser.c:11648 #54 0x00000000009d9c19 in cp_parser_compound_statement(cp_parser*, tree_node*, int, bool) () at ../../gcc/cp/parser.c:11602 #55 0x00000000009f4f46 in cp_parser_implicitly_scoped_statement (parser=parser@entry=0x7ffff1924130, if_p=if_p@entry=0x0, guard_tinfo=..., chain=0x0) at ../../gcc/cp/parser.c:13016 #56 0x00000000009d955d in cp_parser_selection_statement (chain=<optimized out>, if_p=0x0, parser=0x7ffff1924130) at ../../gcc/cp/parser.c:11885