https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105322
Jiu Fu Guo <guojiufu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |guojiufu at gcc dot gnu.org --- Comment #3 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> --- One finding: In trees_out::decl_node, there are code lines: case FIELD_DECL: { if (streaming_p ()) i (tt_data_member); tree ctx = DECL_CONTEXT (decl); tree_node (ctx); //The context, is the struct "S" inside foo, "S" is handled in 'tree_node', and "insert" is called for member "d". tree name = NULL_TREE; if (TREE_CODE (decl) == USING_DECL) ; else { name = DECL_NAME (decl); if (name && IDENTIFIER_ANON_P (name)) name = NULL_TREE; } tree_node (name); if (!name && streaming_p ()) { unsigned ix = get_field_ident (ctx, decl); u (ix); } int tag = insert (decl); //HERE, "insert" is called again member "d". It may be a direct cause that "insert" is called twice for "d", and then a crash occurs. While I do not know much about the code and do not found a fix.