public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562
@ 2021-02-18 15:49 doko at debian dot org
  2021-02-18 16:30 ` [Bug c++/99153] [11 Regression] " nathan at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: doko at debian dot org @ 2021-02-18 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99153
           Summary: ICE: tree check: expected binding_vector, have
                    overload in maybe_record_mergeable_decl, at
                    cp/name-lookup.c:3562
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at debian dot org
  Target Milestone: ---

seen with trunk 20210207, with an installed compiler, empty directory:

$ g++-11 -std=c++20 -fmodules-ts -x c++-system-header iostream
$ g++-11 -std=c++20 -fmodules-ts -x c++-system-header utility
$ g++-11 -std=c++20 -fmodules-ts -x c++-system-header algorithm
In file included from /usr/include/c++/11/bits/stl_iterator_base_types.h:71,
                 from /usr/include/c++/11/bits/stl_algobase.h:65,
                 from /usr/include/c++/11/algorithm:61:
/usr/include/c++/11/bits/iterator_concepts.h:919:54: internal compiler error:
tree check: expected binding_vector, have overload in
maybe_record_mergeable_decl, at cp/name-lookup.c:3562
  919 |       operator==(unreachable_sentinel_t, const _It&) noexcept
      |                                                      ^~~~~~~~
0xe2c617 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../src/gcc/tree.c:9814
0xbfc27c tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../src/gcc/tree.h:3349
0xbfc27c maybe_record_mergeable_decl
        ../../src/gcc/cp/name-lookup.c:3562
0x5ea96a do_pushdecl
        ../../src/gcc/cp/name-lookup.c:3864
0x12cad8d do_pushdecl_with_scope
        ../../src/gcc/cp/name-lookup.c:4886
0x12cd607 pushdecl_namespace_level(tree_node*, bool)
        ../../src/gcc/cp/name-lookup.c:6251
0x142aeac push_template_decl(tree_node*, bool)
        ../../src/gcc/cp/pt.c:6054
0x192f6fe do_friend(tree_node*, tree_node*, tree_node*, tree_node*,
overload_flags, bool)
        ../../src/gcc/cp/friend.c:608
0x13418db grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../src/gcc/cp/decl.c:13613
0x139e169 grokmethod(cp_decl_specifier_seq*, cp_declarator const*, tree_node*)
        ../../src/gcc/cp/decl.c:17489
0x139d880 cp_parser_save_member_function_body
        ../../src/gcc/cp/parser.c:30587
0x1331fcc cp_parser_init_declarator
        ../../src/gcc/cp/parser.c:21557
0x1406b5f cp_parser_single_declaration
        ../../src/gcc/cp/parser.c:30441
0x761a2f cp_parser_template_declaration_after_parameters
        ../../src/gcc/cp/parser.c:30013
0x7544b0 cp_parser_explicit_template_declaration
        ../../src/gcc/cp/parser.c:30279
0x133bef4 cp_parser_member_specification_opt
        ../../src/gcc/cp/parser.c:25740
0x133bef4 cp_parser_class_specifier_1
        ../../src/gcc/cp/parser.c:24818
0x132c600 cp_parser_class_specifier
        ../../src/gcc/cp/parser.c:25134
0x132c600 cp_parser_type_specifier
        ../../src/gcc/cp/parser.c:18381
0x132b40e cp_parser_decl_specifier_seq
        ../../src/gcc/cp/parser.c:15003
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
@ 2021-02-18 16:30 ` nathan at gcc dot gnu.org
  2021-02-19  9:26 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-18 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

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
   Last reconfirmed|                            |2021-02-18
                 CC|                            |nathan at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
  2021-02-18 16:30 ` [Bug c++/99153] [11 Regression] " nathan at gcc dot gnu.org
@ 2021-02-19  9:26 ` rguenth at gcc dot gnu.org
  2021-02-19 13:21 ` nathan at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-19  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
  2021-02-18 16:30 ` [Bug c++/99153] [11 Regression] " nathan at gcc dot gnu.org
  2021-02-19  9:26 ` rguenth at gcc dot gnu.org
@ 2021-02-19 13:21 ` nathan at gcc dot gnu.org
  2021-02-19 22:35 ` [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency nathan at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-19 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
I think this is a duplicate of 99071, which hadn't been done when Mattias
tested.  

However, I am getting a different ICE:
devvm1702:235>./xg++ -B./ -nostdinc++
-I../x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I../x86_64-pc-linux-gnu/libstdc++-v3/include
-I../../..//src/libstdc++-v3/libsupc++
-I../../../src/libstdc++-v3/include/backward
-I../../../src/libstdc++-v3/testsuite/util -std=c++20 -fmodules-ts -x
c++-system-header iostream
devvm1702:236>./xg++ -B./ -nostdinc++
-I../x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I../x86_64-pc-linux-gnu/libstdc++-v3/include
-I../../..//src/libstdc++-v3/libsupc++
-I../../../src/libstdc++-v3/include/backward
-I../../../src/libstdc++-v3/testsuite/util -std=c++20 -fmodules-ts -x
c++-system-header utility
devvm1702:237>./xg++ -B./ -nostdinc++
-I../x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I../x86_64-pc-linux-gnu/libstdc++-v3/include
-I../../..//src/libstdc++-v3/libsupc++
-I../../../src/libstdc++-v3/include/backward
-I../../../src/libstdc++-v3/testsuite/util -std=c++20 -fmodules-ts -x
c++-system-header algorithm
../x86_64-pc-linux-gnu/libstdc++-v3/include/algorithm: internal compiler error:
in make_dependency, at cp/module.cc:12514
0xd06a9a depset::hash::make_dependency(tree_node*, depset::entity_kind)
        ../../../src/gcc/cp/module.cc:12514
0xd07ae1 depset::hash::add_dependency(tree_node*, depset::entity_kind)
        ../../../src/gcc/cp/module.cc:12712
0xcf24e0 trees_out::decl_node(tree_node*, walk_kind)
        ../../../src/gcc/cp/module.cc:8605
0xcf4a73 trees_out::tree_node(tree_node*)
        ../../../src/gcc/cp/module.cc:9168
0xce2700 trees_out::vec_chained_decls(tree_node*)
        ../../../src/gcc/cp/module.cc:4981
0xd02052 trees_out::write_class_def(tree_node*)
        ../../../src/gcc/cp/module.cc:11737

which does appear to be new.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (2 preceding siblings ...)
  2021-02-19 13:21 ` nathan at gcc dot gnu.org
@ 2021-02-19 22:35 ` nathan at gcc dot gnu.org
  2021-02-22 14:52 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-19 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
// B_a.ii
template<typename _T1>
struct pair
{
  inline void Frob ();
};

// B_b.ii
import  "./B_a.ii"

template<class _T1>
inline  void pair<_T1>::Frob()
{ }


./cc1plus -quiet -std=c++20 -fmodule-header  -fpreprocessed B_a.ii && ./cc1plus
-quiet -std=c++20 -fmodule-header  -fpreprocessed B_b.ii
B_b.ii:1: internal compiler error: in make_dependency, at cp/module.cc:12523
    1 | import  "./B_a.ii" [[__translated]];
      | 
0xcd61da depset::hash::make_dependency(tree_node*, depset::entity_kind)
        ../../../src/gcc/cp/module.cc:12523
0xcd7f54 depset::hash::add_class_entities(vec<tree_node*, va_gc, vl_embed>*)
        ../../../src/gcc/cp/module.cc:12942
0xce60bb module_state::write(elf_out*, cpp_reader*)
        ../../../src/gcc/cp/module.cc:17604

The module flags on the TEMPLATE_DECL do not match those of the
DECL_TEMPLATE_RESULT.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (3 preceding siblings ...)
  2021-02-19 22:35 ` [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency nathan at gcc dot gnu.org
@ 2021-02-22 14:52 ` cvs-commit at gcc dot gnu.org
  2021-02-22 14:53 ` nathan at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-22 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:c49fcfddaa47f2828fe2af11ae857cd67f53e23f

commit r11-7322-gc49fcfddaa47f2828fe2af11ae857cd67f53e23f
Author: Nathan Sidwell <nathan@acm.org>
Date:   Mon Feb 22 06:43:32 2021 -0800

    c++: cross-header-unit template definitions [PR 99153]

    A member function can be defined in a different header-file than the
    one defining the class.  In such situations we must unmark the decl as
    imported.  When the entity is a template we failed to unmark the
    template_decl.

    Perhaps the duplication of these flags on the template_decl from the
    underlying decl is an error.  I set on the fence about it for a long
    time during development, but I don't think now is the time to change
    that (barring catastrophic bugs).

            PR c++/99153
            gcc/cp/
            * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
            to common-path.
            * module.cc (set_defining_module): Add assert.
            gcc/testsuite/
            * g++.dg/modules/pr99153_a.H: New.
            * g++.dg/modules/pr99153_b.H: New.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (4 preceding siblings ...)
  2021-02-22 14:52 ` cvs-commit at gcc dot gnu.org
@ 2021-02-22 14:53 ` nathan at gcc dot gnu.org
  2021-02-23 16:52 ` alexander.lelyakin at googlemail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-22 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
 c49fcfddaa4 2021-02-22 | c++: cross-header-unit template definitions [PR
99153] 

I have verified that iostream, utility and algorithm can be built

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (5 preceding siblings ...)
  2021-02-22 14:53 ` nathan at gcc dot gnu.org
@ 2021-02-23 16:52 ` alexander.lelyakin at googlemail dot com
  2021-02-23 17:04 ` alexander.lelyakin at googlemail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-23 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Lelyakin <alexander.lelyakin at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexander.lelyakin@googlema
                   |                            |il.com

--- Comment #5 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
I have found two another sequences of system headers that cannot be compiled:

-------------
g++ -std=c++20 -fmodules-ts -x c++-system-header utility
g++ -std=c++20 -fmodules-ts -x c++-system-header algorithm
g++ -std=c++20 -fmodules-ts -x c++-system-header iostream
g++ -std=c++20 -fmodules-ts -x c++-system-header ranges
g++ -std=c++20 -fmodules-ts -x c++-system-header vector
g++ -std=c++20 -fmodules-ts -x c++-system-header array
g++ -std=c++20 -fmodules-ts -x c++-system-header string
g++ -std=c++20 -fmodules-ts -x c++-system-header functional
--------------
g++ -std=c++20 -fmodules-ts -x c++-system-header concepts
g++ -std=c++20 -fmodules-ts -x c++-system-header functional
g++ -std=c++20 -fmodules-ts -x c++-system-header ranges
g++ -std=c++20 -fmodules-ts -x c++-system-header vector
g++ -std=c++20 -fmodules-ts -x c++-system-header string
g++ -std=c++20 -fmodules-ts -x c++-system-header algorithm
--------------

Tried on last version from git:

commit e03e58c1844d04678f95b278f3eff2a5fbaeff7

g++ (GCC) 11.0.0 20210223 (experimental)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (6 preceding siblings ...)
  2021-02-23 16:52 ` alexander.lelyakin at googlemail dot com
@ 2021-02-23 17:04 ` alexander.lelyakin at googlemail dot com
  2021-02-23 17:34 ` alexander.lelyakin at googlemail dot com
  2021-02-23 18:01 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-23 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
Another, shorter sequence:
----
g++ -std=c++20 -fmodules-ts -x c++-system-header new
g++ -std=c++20 -fmodules-ts -x c++-system-header initializer_list
g++ -std=c++20 -fmodules-ts -x c++-system-header typeinfo
g++ -std=c++20 -fmodules-ts -x c++-system-header type_traits
g++ -std=c++20 -fmodules-ts -x c++-system-header exception
----
/usr/local/include/c++/11.0.0/exception: internal compiler error: in
write_cluster, at cp/module.cc:14600
0x6e2d56 module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        ../../gcc/gcc/cp/module.cc:14600
0xa62be8 module_state::write(elf_out*, cpp_reader*)
        ../../gcc/gcc/cp/module.cc:17734
0xa638fc finish_module_processing(cpp_reader*)
        ../../gcc/gcc/cp/module.cc:19860
0x9f72cb c_parse_final_cleanups()
        ../../gcc/gcc/cp/decl2.c:5175

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (7 preceding siblings ...)
  2021-02-23 17:04 ` alexander.lelyakin at googlemail dot com
@ 2021-02-23 17:34 ` alexander.lelyakin at googlemail dot com
  2021-02-23 18:01 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-23 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
I write a shell script to try to compile c++ system headers in random order:
Results so far:

Shortest sequences up to internal compiler error:
-----
type_traits
thread
-----
clocale
barrier
-----

Longest sequence is:
-----
stop_token
ccomplex
version
cassert
csetjmp
condition_variable
shared_mutex
csignal
map
cstdalign
bitset
scoped_allocator
codecvt
barrier
span
mutex
optional
ctgmath
cstdio
typeindex
cctype
cwctype
cfloat
iosfwd
iostream
----

Anyway there is no way to compile all system headers :(

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency
  2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
                   ` (8 preceding siblings ...)
  2021-02-23 17:34 ` alexander.lelyakin at googlemail dot com
@ 2021-02-23 18:01 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-23 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
99222 and 99223 filed.  Please file each case as a separate issue.  So far,
they've all been different underlying causes.

It might make sense to have a meta-bug referring to this class of issue.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-02-23 18:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 15:49 [Bug c++/99153] New: ICE: tree check: expected binding_vector, have overload in maybe_record_mergeable_decl, at cp/name-lookup.c:3562 doko at debian dot org
2021-02-18 16:30 ` [Bug c++/99153] [11 Regression] " nathan at gcc dot gnu.org
2021-02-19  9:26 ` rguenth at gcc dot gnu.org
2021-02-19 13:21 ` nathan at gcc dot gnu.org
2021-02-19 22:35 ` [Bug c++/99153] [11 Regression] ICE: depset::hash::make_dependency nathan at gcc dot gnu.org
2021-02-22 14:52 ` cvs-commit at gcc dot gnu.org
2021-02-22 14:53 ` nathan at gcc dot gnu.org
2021-02-23 16:52 ` alexander.lelyakin at googlemail dot com
2021-02-23 17:04 ` alexander.lelyakin at googlemail dot com
2021-02-23 17:34 ` alexander.lelyakin at googlemail dot com
2021-02-23 18:01 ` 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).