public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403
@ 2021-02-24  8:43 alexander.lelyakin at googlemail dot com
  2021-03-27  6:48 ` [Bug c++/99242] [modules] ICE " alexander.lelyakin at googlemail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-24  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99242
           Summary: internal compiler error: in lookup_mark, at
                    cp/tree.c:2403
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexander.lelyakin at googlemail dot com
  Target Milestone: ---

g++ -std=c++20 -fmodules-ts -x c++-system-header ios
g++ -std=c++20 -fmodules-ts -x c++-system-header exception
g++ -std=c++20 -fmodules-ts -x c++-system-header list
g++ -std=c++20 -fmodules-ts -x c++-system-header cstdlib
g++ -std=c++20 -fmodules-ts -x c++-system-header bit
g++ -std=c++20 -fmodules-ts -x c++-system-header cinttypes
g++ -std=c++20 -fmodules-ts -x c++-system-header memory
---------
In file included from
/usr/local/include/c++/11.0.0/bits/ranges_uninitialized.h:36,
                 from /usr/local/include/c++/11.0.0/memory:86:
/usr/local/include/c++/11.0.0/bits/ranges_algobase.h: In function ‘constexpr
std::conditional_t<_IsMove, std::ranges::in_out_result<_Iter, _Out>,
std::ranges::in_out_result<_Iter, _Out> > std::ranges::__copy_or_move(_Iter,
_Sent, _Out)’:
/usr/local/include/c++/11.0.0/bits/ranges_algobase.h:253:21: internal compiler
error: in lookup_mark, at cp/tree.c:2403
  253 |           if (!std::is_constant_evaluated())
      |                     ^~~~~~~~~~~~~~~~~~~~~
0x73a27e lookup_mark(tree_node*, bool)
        ../../gcc/gcc/cp/tree.c:2403
0xa7cc7d name_lookup::search_namespace_only(tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:955
0xa7cdba name_lookup::search_namespace(tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:1013
0xa7cdba name_lookup::search_namespace(tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:1006
0xa7d236 name_lookup::search_qualified(tree_node*, bool)
        ../../gcc/gcc/cp/name-lookup.c:1074
0xa7d236 name_lookup::search_qualified(tree_node*, bool)
        ../../gcc/gcc/cp/name-lookup.c:1066
0xa8162f qualified_namespace_lookup
        ../../gcc/gcc/cp/name-lookup.c:7225
0xa82648 lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
        ../../gcc/gcc/cp/name-lookup.c:7186
0xa8febc cp_parser_lookup_name
        ../../gcc/gcc/cp/parser.c:29199
0xab9777 cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:24612
0xab9a79 cp_parser_type_name
        ../../gcc/gcc/cp/parser.c:19153
0xac6286 cp_parser_simple_type_specifier
        ../../gcc/gcc/cp/parser.c:18856
0xaae883 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7420
0xac4bd7 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8736
0xa9884a cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9825
0xa9917c cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:10130
0xa9a6c2 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:10298
0xac085a cp_parser_condition
        ../../gcc/gcc/cp/parser.c:12603
0xaa9968 cp_parser_selection_statement
        ../../gcc/gcc/cp/parser.c:12257
0xaa9968 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:11623
------
g++ (GCC) 11.0.0 20210223 (experimental)

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
@ 2021-03-27  6:48 ` alexander.lelyakin at googlemail dot com
  2023-06-01  0:12 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-27  6:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence:

/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header stdexcept
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header atomic
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header semaphore
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header
condition_variable
----
In file included from /usr/local/include/c++/11.0.1/condition_variable:47:
/usr/local/include/c++/11.0.1/stop_token:83:29: internal compiler error: in
lookup_mark, at cp/tree.c:2403
   83 |     swap(stop_token& __rhs) noexcept
      |                             ^~~~~~~~
0x73cce0 lookup_mark(tree_node*, bool)
        ../../gcc/gcc/cp/tree.c:2403
0xa81c51 name_lookup::dedup(bool)
        ../../gcc/gcc/cp/name-lookup.c:482
0xa81c51 name_lookup::dedup(bool)
        ../../gcc/gcc/cp/name-lookup.c:477
0xa81c51 name_lookup::search_namespace_only(tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:958
0xa831bb name_lookup::search_unqualified(tree_node*, cp_binding_level*)
        ../../gcc/gcc/cp/name-lookup.c:1158
0xa85eb4 lookup_name_1
        ../../gcc/gcc/cp/name-lookup.c:7804
0xa860c4 lookup_name(tree_node*, LOOK_where, LOOK_want)
        ../../gcc/gcc/cp/name-lookup.c:7824
0xa860c4 lookup_name(tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:7832
0x9f2eca find_last_decl
        ../../gcc/gcc/cp/decl2.c:1509
0x9f2eca cplus_decl_attributes(tree_node**, tree_node*, int)
        ../../gcc/gcc/cp/decl2.c:1595
0x9d4b8c grokfndecl
        ../../gcc/gcc/cp/decl.c:10061
0x9dcddd grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../gcc/gcc/cp/decl.c:13579
0x9e9be8 grokmethod(cp_decl_specifier_seq*, cp_declarator const*, tree_node*)
        ../../gcc/gcc/cp/decl.c:17564
0xa9aa68 cp_parser_save_member_function_body
        ../../gcc/gcc/cp/parser.c:30663
0xad7a8a cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:26326
0xaa7998 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:25799
0xaa7998 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:24877
0xaa9ec3 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:25193
0xaa9ec3 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:18440
0xaaae59 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:15062
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.
----
g++ (GCC) 11.0.1 20210326 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
  2021-03-27  6:48 ` [Bug c++/99242] [modules] ICE " alexander.lelyakin at googlemail dot com
@ 2023-06-01  0:12 ` pinskia at gcc dot gnu.org
  2023-06-05 13:57 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-01  0:12 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |saifi.khan at nishan dot io

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 110056 has been marked as a duplicate of this bug. ***

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
  2021-03-27  6:48 ` [Bug c++/99242] [modules] ICE " alexander.lelyakin at googlemail dot com
  2023-06-01  0:12 ` pinskia at gcc dot gnu.org
@ 2023-06-05 13:57 ` redi at gcc dot gnu.org
  2024-03-16 18:24 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2023-06-05 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-06-05

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
                   ` (2 preceding siblings ...)
  2023-06-05 13:57 ` redi at gcc dot gnu.org
@ 2024-03-16 18:24 ` ppalka at gcc dot gnu.org
  2024-03-16 18:28 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-16 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
A curious reduction:

$ cat 99241_a.H
bool __is_constant_evaluated();

$ cat 99241_b.H
bool __is_constant_evaluated();

$ cat 99241_c.H
bool __is_constant_evaluated();

$ cat 99241_d.C
bool __is_constant_evaluated();                                                 
import "99241_a.ii";                                
void f() { __is_constant_evaluated(); }                                         
import "99241_b.ii";                                
import "99241_c.ii";                                                            
void g() { __is_constant_evaluated(); } 

$ g++ -fmodules-ts 99241_*
99241_d.ii: In function ‘void g()’:
99241_d.ii:6:12: internal compiler error: in lookup_mark, at cp/tree.cc:2474
    6 | void g() { __is_constant_evaluated(); }
      |            ^~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
                   ` (3 preceding siblings ...)
  2024-03-16 18:24 ` ppalka at gcc dot gnu.org
@ 2024-03-16 18:28 ` ppalka at gcc dot gnu.org
  2024-07-17  1:24 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-16 18:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
A curious reduction:

$ cat 99242_a.H
bool __is_constant_evaluated();

$ cat 99242_b.H
bool __is_constant_evaluated();

$ cat 99242_c.H
bool __is_constant_evaluated();

$ cat 99242_d.C
bool __is_constant_evaluated();                                                 
import "99242_a.H";                                
void f() { __is_constant_evaluated(); }                                         
import "99242_b.H";                                
import "99242_c.H";                                                             
void g() { __is_constant_evaluated(); } 

$ g++ -fmodules-ts 99241_*
99242_d.C: In function ‘void g()’:
99242_d.C:6:12: internal compiler error: in lookup_mark, at cp/tree.cc:2474
    6 | void g() { __is_constant_evaluated(); }
      |            ^~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
                   ` (4 preceding siblings ...)
  2024-03-16 18:28 ` ppalka at gcc dot gnu.org
@ 2024-07-17  1:24 ` cvs-commit at gcc dot gnu.org
  2024-07-17  2:08 ` cvs-commit at gcc dot gnu.org
  2024-07-17  2:15 ` nshead at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-07-17  1:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

https://gcc.gnu.org/g:1aa0f1627857c3e2d90982bdb07ca78ca10b26f3

commit r15-2079-g1aa0f1627857c3e2d90982bdb07ca78ca10b26f3
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Mon Jul 8 22:25:17 2024 +1000

    c++/modules: Propagate BINDING_VECTOR_*_DUPS_P on realloc [PR99242]

    When importing modules, when a binding vector for a name runs out of
    slots it gets reallocated with a larger size, and existing bindings are
    copied across.  However, the flags to indicate whether deduping needs to
    occur did not: this causes ICEs, as it allows a duplicate binding to be
    added which then violates assumptions later on.

            PR c++/99242

    gcc/cp/ChangeLog:

            * name-lookup.cc (append_imported_binding_slot): Propagate dups
            flags.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr99242_a.H: New test.
            * g++.dg/modules/pr99242_b.H: New test.
            * g++.dg/modules/pr99242_c.H: New test.
            * g++.dg/modules/pr99242_d.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
                   ` (5 preceding siblings ...)
  2024-07-17  1:24 ` cvs-commit at gcc dot gnu.org
@ 2024-07-17  2:08 ` cvs-commit at gcc dot gnu.org
  2024-07-17  2:15 ` nshead at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-07-17  2:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Nathaniel Shead
<nshead@gcc.gnu.org>:

https://gcc.gnu.org/g:5fad0b552c5851fb6ae6eb3616e50cc25af1391d

commit r14-10442-g5fad0b552c5851fb6ae6eb3616e50cc25af1391d
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Mon Jul 8 22:25:17 2024 +1000

    c++/modules: Propagate BINDING_VECTOR_*_DUPS_P on realloc [PR99242]

    When importing modules, when a binding vector for a name runs out of
    slots it gets reallocated with a larger size, and existing bindings are
    copied across.  However, the flags to indicate whether deduping needs to
    occur did not: this causes ICEs, as it allows a duplicate binding to be
    added which then violates assumptions later on.

            PR c++/99242

    gcc/cp/ChangeLog:

            * name-lookup.cc (append_imported_binding_slot): Propagate dups
            flags.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr99242_a.H: New test.
            * g++.dg/modules/pr99242_b.H: New test.
            * g++.dg/modules/pr99242_c.H: New test.
            * g++.dg/modules/pr99242_d.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
    (cherry picked from commit 1aa0f1627857c3e2d90982bdb07ca78ca10b26f3)

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

* [Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403
  2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
                   ` (6 preceding siblings ...)
  2024-07-17  2:08 ` cvs-commit at gcc dot gnu.org
@ 2024-07-17  2:15 ` nshead at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-07-17  2:15 UTC (permalink / raw)
  To: gcc-bugs

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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.2
                 CC|                            |nshead at gcc dot gnu.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|nathan at gcc dot gnu.org          |nshead at gcc dot gnu.org

--- Comment #7 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Fixed for GCC 14.2 / trunk.

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

end of thread, other threads:[~2024-07-17  2:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24  8:43 [Bug c++/99242] New: internal compiler error: in lookup_mark, at cp/tree.c:2403 alexander.lelyakin at googlemail dot com
2021-03-27  6:48 ` [Bug c++/99242] [modules] ICE " alexander.lelyakin at googlemail dot com
2023-06-01  0:12 ` pinskia at gcc dot gnu.org
2023-06-05 13:57 ` redi at gcc dot gnu.org
2024-03-16 18:24 ` ppalka at gcc dot gnu.org
2024-03-16 18:28 ` ppalka at gcc dot gnu.org
2024-07-17  1:24 ` cvs-commit at gcc dot gnu.org
2024-07-17  2:08 ` cvs-commit at gcc dot gnu.org
2024-07-17  2:15 ` nshead 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).