From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E4E0385EC53; Tue, 25 Jan 2022 23:09:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E4E0385EC53 From: "nemanjab at amazon dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree Date: Tue, 25 Jan 2022 23:09:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nemanjab at amazon dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2022 23:09:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104234 Bug ID: 104234 Summary: ICE with -fmodules-ts and std::map/_Rb_tree Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nemanjab at amazon dot com Target Milestone: --- Hello, I found an ICE with -fmodules-ts and reduced it to: ``` template struct _Node_handle_common { template friend class _Rb_tree; }; struct _Hashtable { using node_type =3D _Node_handle_common; node_type __trans_tmp_1; }; template struct _Rb_tree { struct _Rb_tree_impl { _Rb_tree_impl(); } _M_impl; }; _Rb_tree _M_tmap_; ``` gcc version 12.0.1 20220125/master, fails with gcc version 11.2.0 as well: ``` repro.cpp:8:28: internal compiler error: tree check: expected class =E2=80= =98type=E2=80=99, have =E2=80=98declaration=E2=80=99 (type_decl) in get_originating_module_de= cl, at cp/module.cc:18339 8 | template struct _Rb_tree { | ^~~~~~~~ 0x90b6a5 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.cc:8752 0x76bfb2 tree_class_check(tree_node*, tree_code_class, char const*, int, ch= ar const*) ../../gcc/gcc/tree.h:3564 0x76bfb2 get_originating_module_decl(tree_node*) ../../gcc/gcc/cp/module.cc:18339 0xb10ea7 get_originating_module(tree_node*, bool) ../../gcc/gcc/cp/module.cc:18378 0xae670c maybe_write_module ../../gcc/gcc/cp/mangle.cc:901 0xae670c write_name ../../gcc/gcc/cp/mangle.cc:969 0xae8f16 write_encoding ../../gcc/gcc/cp/mangle.cc:811 0xae96fa mangle_decl_string ../../gcc/gcc/cp/mangle.cc:4034 0xae98ea get_mangled_id ../../gcc/gcc/cp/mangle.cc:4055 0xae98ea mangle_decl(tree_node*) ../../gcc/gcc/cp/mangle.cc:4093 0x14d62cd decl_assembler_name(tree_node*) ../../gcc/gcc/tree.cc:715 0x1531f81 notice_global_symbol(tree_node*) ../../gcc/gcc/varasm.cc:1801 0xd88b5a cgraph_node::finalize_function(tree_node*, bool) ../../gcc/gcc/cgraphunit.cc:453 0xc1677f expand_or_defer_fn(tree_node*) ../../gcc/gcc/cp/semantics.cc:4791 0xb498f4 maybe_clone_body(tree_node*) ../../gcc/gcc/cp/optimize.cc:700 0xc16495 expand_or_defer_fn_1(tree_node*) ../../gcc/gcc/cp/semantics.cc:4755 0xc16758 expand_or_defer_fn(tree_node*) ../../gcc/gcc/cp/semantics.cc:4786 0xaf8060 synthesize_method(tree_node*) ../../gcc/gcc/cp/method.cc:1840 0xab045d mark_used(tree_node*, int) ../../gcc/gcc/cp/decl2.cc:5938 0x9f851a build_over_call ../../gcc/gcc/cp/call.cc:9860 ```=