public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/99208] New: [modules] ICE with partitions & instantiations of linkage-typedef structs @ 2021-02-22 18:20 nathan at gcc dot gnu.org 2021-02-22 18:20 ` [Bug c++/99208] " nathan at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: nathan at gcc dot gnu.org @ 2021-02-22 18:20 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99208 Bug ID: 99208 Summary: [modules] ICE with partitions & instantiations of linkage-typedef structs Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nathan at gcc dot gnu.org Target Milestone: --- Triaging 98718 ran into this: // b_a.ii module; # 3 "b_a.ii" 1 typedef struct {} __mbstate_t; template<typename _StateT> class fpos; # 6 "" 2 export module hello:format; export void format (const fpos<__mbstate_t> &); // b_b.ii export module hello; export import :format; zathras:94>./cc1plus -quiet -fmodules-ts b_a.ii && ./cc1plus -quiet -fmodules-ts b_b.ii b_b.ii:1:8: internal compiler error: in insert, at cp/module.cc:4904 1 | export module hello; | ^~~~~~ 0xcb1949 trees_out::insert(tree_node*, walk_kind) ../../../src/gcc/cp/module.cc:4904 0xcbaf8f trees_out::add_indirects(tree_node*) ../../../src/gcc/cp/module.cc:7328 0xcc1f6a trees_out::decl_node(tree_node*, walk_kind) ../../../src/gcc/cp/module.cc:8677 0xcc41c1 trees_out::tree_node(tree_node*) ../../../src/gcc/cp/module.cc:9179 0xcb1e4e trees_out::vec_chained_decls(tree_node*) ../../../src/gcc/cp/module.cc:4992 0xcd17a0 trees_out::write_class_def(tree_node*) ../../../src/gcc/cp/module.cc:11748 0xcd5947 trees_out::write_definition(tree_node*) ../../../src/gcc/cp/module.cc:12356 0xcd9299 depset::hash::find_dependencies(module_state*) ../../../src/gcc/cp/module.cc:13238 0xce60ed module_state::write(elf_out*, cpp_reader*) ../../../src/gcc/cp/module.cc:17611 0xcec92c finish_module_processing(cpp_reader*) ../../../src/gcc/cp/module.cc:19860 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99208] [modules] ICE with partitions & instantiations of linkage-typedef structs 2021-02-22 18:20 [Bug c++/99208] New: [modules] ICE with partitions & instantiations of linkage-typedef structs nathan at gcc dot gnu.org @ 2021-02-22 18:20 ` nathan at gcc dot gnu.org 2021-02-23 15:18 ` cvs-commit at gcc dot gnu.org 2021-02-23 15:18 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: nathan at gcc dot gnu.org @ 2021-02-22 18:20 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99208 Nathan Sidwell <nathan at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |nathan at gcc dot gnu.org Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2021-02-22 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99208] [modules] ICE with partitions & instantiations of linkage-typedef structs 2021-02-22 18:20 [Bug c++/99208] New: [modules] ICE with partitions & instantiations of linkage-typedef structs nathan at gcc dot gnu.org 2021-02-22 18:20 ` [Bug c++/99208] " nathan at gcc dot gnu.org @ 2021-02-23 15:18 ` cvs-commit at gcc dot gnu.org 2021-02-23 15:18 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2021-02-23 15:18 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99208 --- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>: https://gcc.gnu.org/g:47145e6916f58e1cd4f562c06fa7289da49f690c commit r11-7347-g47145e6916f58e1cd4f562c06fa7289da49f690c Author: Nathan Sidwell <nathan@acm.org> Date: Tue Feb 23 07:08:55 2021 -0800 c++: typedef for linkage [PR 99208] Unnamed types with a typedef name for linkage were always troublesome in modules. This is the underlying cause of that trouble -- we were creating incorrect type structures. Classes have an implicit self-reference, and we created that for unnamed classes too. It turns out we make use of this member, so just not generating it turned into a rathole. This member is created using the anonymous name -- because we've not yet met the typedef name. When we retrofit the typedef name we were checking identifier matching and changing all type variants with that identifier. Which meant we ended up with a strange typedef for the self reference. This fixes things to check for DECL identity of the variants, so we don't smash the self-reference -- that continues to have the anonymous name. PR c++/99208 gcc/cp/ * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER identity. gcc/testsuite/ * g++.dg/modules/pr99208_a.C: New. * g++.dg/modules/pr99208_b.C: New. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99208] [modules] ICE with partitions & instantiations of linkage-typedef structs 2021-02-22 18:20 [Bug c++/99208] New: [modules] ICE with partitions & instantiations of linkage-typedef structs nathan at gcc dot gnu.org 2021-02-22 18:20 ` [Bug c++/99208] " nathan at gcc dot gnu.org 2021-02-23 15:18 ` cvs-commit at gcc dot gnu.org @ 2021-02-23 15:18 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: nathan at gcc dot gnu.org @ 2021-02-23 15:18 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99208 Nathan Sidwell <nathan at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> --- 47145e6916f 2021-02-23 | c++: typedef for linkage [PR 99208] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-23 15:18 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-02-22 18:20 [Bug c++/99208] New: [modules] ICE with partitions & instantiations of linkage-typedef structs nathan at gcc dot gnu.org 2021-02-22 18:20 ` [Bug c++/99208] " nathan at gcc dot gnu.org 2021-02-23 15:18 ` cvs-commit at gcc dot gnu.org 2021-02-23 15:18 ` nathan at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).