public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick.kox at commandoregel dot be" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/98462] New: ICE when making iomanip module and all modules after it
Date: Mon, 28 Dec 2020 13:53:58 +0000	[thread overview]
Message-ID: <bug-98462-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98462

            Bug ID: 98462
           Summary: ICE when making iomanip module and all modules after
                    it
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.kox at commandoregel dot be
  Target Milestone: ---

With the previous snapshot of gcc-11-20201220 the following command failed: g++
-fmodules-ts -std=c++20 -c -x c++-system-header iostream.

This is solved by the current version (gcc-11-20201227) but now running this
command on iomanip fails. And when it does, iostream (and other also fail).

So for example when I do it in the following order only iomanip fails:
g++ -fmodules-ts -std=c++20 -c -x c++-system-header cmath
g++ -fmodules-ts -std=c++20 -c -x c++-system-header cwchar
g++ -fmodules-ts -std=c++20 -c -x c++-system-header iostream
g++ -fmodules-ts -std=c++20 -c -x c++-system-header string
g++ -fmodules-ts -std=c++20 -c -x c++-system-header string_view
g++ -fmodules-ts -std=c++20 -c -x c++-system-header iomanip

but when I execute the command with iomanip before the others they also fail
and deleting the entire gcm.cache directory seems to solve this.

The output of the error message is:
$ Modules $ g++ -fmodules-ts -std=c++20 -c -x c++-system-header iomanip 
In file included from /opt/gcc-11/include/c++/11.0.0/bits/functexcept.h:40,
                 from /opt/gcc-11/include/c++/11.0.0/bits/stl_algobase.h:60,
                 from /opt/gcc-11/include/c++/11.0.0/bits/char_traits.h:39,
                 from /opt/gcc-11/include/c++/11.0.0/string:40,
of module /opt/gcc-11/include/c++/11.0.0/string, imported at
/opt/gcc-11/include/c++/11.0.0/bits/locale_classes.h:40,
        included from /opt/gcc-11/include/c++/11.0.0/bits/ios_base.h:41,
                 from /opt/gcc-11/include/c++/11.0.0/iomanip:40:
/opt/gcc-11/include/c++/11.0.0/bits/locale_classes.h:461:11: internal compiler
error: in duplicate_decls, at cp/decl.c:2022
  461 |           __catch(...)
      |           ^~~~~~~
0x66a2ba duplicate_decls(tree_node*, tree_node*, bool, bool)
        ../../gcc/cp/decl.c:2022
0xa38d2e check_module_override
        ../../gcc/cp/name-lookup.c:3651
0xa38d2e do_pushdecl
        ../../gcc/cp/name-lookup.c:3774
0xa39a21 do_pushdecl
        ../../gcc/cp/name-lookup.c:4881
0xa39a21 do_pushdecl_with_scope
        ../../gcc/cp/name-lookup.c:4881
0xa39c85 pushdecl_namespace_level(tree_node*, bool)
        ../../gcc/cp/name-lookup.c:6245
0xa3ae94 pushdecl_top_level(tree_node*)
        ../../gcc/cp/name-lookup.c:8717
0x9bce22 declare_library_fn
        ../../gcc/cp/except.c:172
0x9bda0d do_end_catch
        ../../gcc/cp/except.c:254
0x9bda0d push_eh_cleanup
        ../../gcc/cp/except.c:270
0x9bda0d expand_start_catch_block(tree_node*)
        ../../gcc/cp/except.c:408
0xaf66d4 finish_handler_parms(tree_node*, tree_node*)
        ../../gcc/cp/semantics.c:1492
0xa7e443 cp_parser_handler
        ../../gcc/cp/parser.c:27086
0xa5ece7 cp_parser_handler_seq
        ../../gcc/cp/parser.c:27061
0xa5ece7 cp_parser_try_block
        ../../gcc/cp/parser.c:27015
0xa5ece7 cp_parser_statement
        ../../gcc/cp/parser.c:11654
0xa5ff9d cp_parser_statement_seq_opt
        ../../gcc/cp/parser.c:12112
0xa60078 cp_parser_compound_statement
        ../../gcc/cp/parser.c:12062
0xa7fe6d cp_parser_implicitly_scoped_statement
        ../../gcc/cp/parser.c:13577
0xa5f754 cp_parser_selection_statement
        ../../gcc/cp/parser.c:12293
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

and this is the error I get when I (for example) execute the command with
iostream:
$ Modules $ g++ -fmodules-ts -std=c++20 -c -x c++-system-header iostream
In file included from /opt/gcc-11/include/c++/11.0.0/bits/functexcept.h:40,
                 from /opt/gcc-11/include/c++/11.0.0/bits/stl_algobase.h:60,
                 from /opt/gcc-11/include/c++/11.0.0/bits/char_traits.h:39,
                 from /opt/gcc-11/include/c++/11.0.0/string:40,
of module /opt/gcc-11/include/c++/11.0.0/string, imported at
/opt/gcc-11/include/c++/11.0.0/bits/locale_classes.h:40,
        included from /opt/gcc-11/include/c++/11.0.0/bits/ios_base.h:41,
                 from /opt/gcc-11/include/c++/11.0.0/ios:42,
                 from /opt/gcc-11/include/c++/11.0.0/ostream:38,
                 from /opt/gcc-11/include/c++/11.0.0/iostream:39:
/opt/gcc-11/include/c++/11.0.0/bits/locale_classes.h:461:11: internal compiler
error: in duplicate_decls, at cp/decl.c:2022
  461 |           __catch(...)
      |           ^~~~~~~
0x66a2ba duplicate_decls(tree_node*, tree_node*, bool, bool)
        ../../gcc/cp/decl.c:2022
0xa38d2e check_module_override
        ../../gcc/cp/name-lookup.c:3651
0xa38d2e do_pushdecl
        ../../gcc/cp/name-lookup.c:3774
0xa39a21 do_pushdecl
        ../../gcc/cp/name-lookup.c:4881
0xa39a21 do_pushdecl_with_scope
        ../../gcc/cp/name-lookup.c:4881
0xa39c85 pushdecl_namespace_level(tree_node*, bool)
        ../../gcc/cp/name-lookup.c:6245
0xa3ae94 pushdecl_top_level(tree_node*)
        ../../gcc/cp/name-lookup.c:8717
0x9bce22 declare_library_fn
        ../../gcc/cp/except.c:172
0x9bda0d do_end_catch
        ../../gcc/cp/except.c:254
0x9bda0d push_eh_cleanup
        ../../gcc/cp/except.c:270
0x9bda0d expand_start_catch_block(tree_node*)
        ../../gcc/cp/except.c:408
0xaf66d4 finish_handler_parms(tree_node*, tree_node*)
        ../../gcc/cp/semantics.c:1492
0xa7e443 cp_parser_handler
        ../../gcc/cp/parser.c:27086
0xa5ece7 cp_parser_handler_seq
        ../../gcc/cp/parser.c:27061
0xa5ece7 cp_parser_try_block
        ../../gcc/cp/parser.c:27015
0xa5ece7 cp_parser_statement
        ../../gcc/cp/parser.c:11654
0xa5ff9d cp_parser_statement_seq_opt
        ../../gcc/cp/parser.c:12112
0xa60078 cp_parser_compound_statement
        ../../gcc/cp/parser.c:12062
0xa7fe6d cp_parser_implicitly_scoped_statement
        ../../gcc/cp/parser.c:13577
0xa5f754 cp_parser_selection_statement
        ../../gcc/cp/parser.c:12293
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

             reply	other threads:[~2020-12-28 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:53 patrick.kox at commandoregel dot be [this message]
2021-01-05 13:37 ` [Bug c++/98462] " nathan at gcc dot gnu.org
2024-03-13 13:29 ` [Bug c++/98462] [modules] " ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98462-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).