public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/99174] New: [modules] ICE with recursive inclusion of header-unit @ 2021-02-19 21:52 nathan at gcc dot gnu.org 2021-02-22 13:46 ` [Bug c++/99174] " 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-19 21:52 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99174 Bug ID: 99174 Summary: [modules] ICE with recursive inclusion of header-unit 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: --- self-inclusion considered dangerous // 1_b.ii import "./1_b.ii"; ./cc1plus -quiet -std=c++20 -fmodule-header 1_b.ii 1_b.ii:1:1: internal compiler error: in read_preprocessor, at cp/module.cc:17891 1 | import "./1_b.ii"; | ^~~~~~ 0xce6da8 module_state::read_preprocessor(bool) ../../../src/gcc/cp/module.cc:17891 0xceb5db preprocess_module(module_state*, unsigned int, bool, bool, bool, cpp_reader*) ../../../src/gcc/cp/module.cc:19446 0xc73707 module_token_filter::resume(int, int, tree_node*, unsigned int) ../../../src/gcc/cp/lex.c:520 0xc71c69 module_token_lang(int, int, tree_node*, unsigned int, unsigned long) ../../../src/gcc/cp/lex.c:557 0xd26638 cp_lexer_new_main ../../../src/gcc/cp/parser.c:658 0xd90362 c_parse_file() ../../../src/gcc/cp/parser.c:45168 0xf5194e c_common_parse_file() ../../../src/gcc/c-family/c-opts.c:1218 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99174] [modules] ICE with recursive inclusion of header-unit 2021-02-19 21:52 [Bug c++/99174] New: [modules] ICE with recursive inclusion of header-unit nathan at gcc dot gnu.org @ 2021-02-22 13:46 ` nathan at gcc dot gnu.org 2021-02-22 15:51 ` cvs-commit at gcc dot gnu.org 2021-02-22 15:53 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: nathan at gcc dot gnu.org @ 2021-02-22 13:46 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99174 Nathan Sidwell <nathan at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |nathan at gcc dot gnu.org Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2021-02-22 Ever confirmed|0 |1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99174] [modules] ICE with recursive inclusion of header-unit 2021-02-19 21:52 [Bug c++/99174] New: [modules] ICE with recursive inclusion of header-unit nathan at gcc dot gnu.org 2021-02-22 13:46 ` [Bug c++/99174] " nathan at gcc dot gnu.org @ 2021-02-22 15:51 ` cvs-commit at gcc dot gnu.org 2021-02-22 15:53 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2021-02-22 15:51 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99174 --- 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:afed55036b65526be006d55f003f670ebeadb223 commit r11-7324-gafed55036b65526be006d55f003f670ebeadb223 Author: Nathan Sidwell <nathan@acm.org> Date: Mon Feb 22 07:43:56 2021 -0800 c++: Recursing header imports and other duplicates [PR 99174] The fix for 98741 introduced two issues. (a) recursive header units iced because we tried to read the preprocessor state after having failed to read the config. (b) we could have duplicate imports of named modules in our pending queue, and that would lead to duplicate requests for pathnames, which coupled with the use of a null-pathname to indicate we'd asked could lead to desynchronization with the module mapper. Fixed by adding a 'visited' flag to module state, so we ask exactly once. PR c++/99174 gcc/cp * module.cc (struct module_state): Add visited_p flag. (name_pending_imports): Use it to avoid duplicate requests. (preprocess_module): Don't read preprocessor state if we failed to load a module's config. gcc/testsuite/ * g++.dg/modules/pr99174-1_a.C: New. * g++.dg/modules/pr99174-1_b.C: New. * g++.dg/modules/pr99174-1_c.C: New. * g++.dg/modules/pr99174.H: New. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/99174] [modules] ICE with recursive inclusion of header-unit 2021-02-19 21:52 [Bug c++/99174] New: [modules] ICE with recursive inclusion of header-unit nathan at gcc dot gnu.org 2021-02-22 13:46 ` [Bug c++/99174] " nathan at gcc dot gnu.org 2021-02-22 15:51 ` cvs-commit at gcc dot gnu.org @ 2021-02-22 15:53 ` nathan at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: nathan at gcc dot gnu.org @ 2021-02-22 15:53 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99174 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> --- afed55036b6 2021-02-22 | c++: Recursing header imports and other duplicates [PR 99174] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-22 15:53 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-02-19 21:52 [Bug c++/99174] New: [modules] ICE with recursive inclusion of header-unit nathan at gcc dot gnu.org 2021-02-22 13:46 ` [Bug c++/99174] " nathan at gcc dot gnu.org 2021-02-22 15:51 ` cvs-commit at gcc dot gnu.org 2021-02-22 15:53 ` 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).