public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type,  at tree.c:6593
@ 2020-12-16 18:40 gscfq@t-online.de
  2020-12-17 11:20 ` [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2020-12-16 18:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98333
           Summary: [10/11 Regression] ICE in check_qualified_type, at
                    tree.c:6593
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20190616 and 20190623, with an extra "()" :


$ cat z1.cc
struct T
{
  template <class> struct S
  { S () noexcept () {} };
  int a = __has_nothrow_constructor (S<int>);
};


$ g++-11-20201213 -c z1.cc
z1.cc: In instantiation of 'T::S< <template-parameter-1-1> >::S() [with
<template-parameter-1-1> = int]':
z1.cc:5:44:   required from here
z1.cc:4:5: internal compiler error: Segmentation fault
    4 |   { S () noexcept () {} };
      |     ^
0xc8f5ff crash_signal
        ../../gcc/toplev.c:327
0xf00280 check_qualified_type(tree_node const*, tree_node const*, int)
        ../../gcc/tree.c:6593
0xf00384 get_qualified_type(tree_node*, int)
        ../../gcc/tree.c:6625
0xf0d6b3 build_qualified_type(tree_node*, int)
        ../../gcc/tree.c:6656
0x654566 strip_top_quals(tree_node*)
        ../../gcc/cp/call.c:1177
0x654566 standard_conversion
        ../../gcc/cp/call.c:1202
0x656c7a implicit_conversion_1
        ../../gcc/cp/call.c:2008
0x656c7a implicit_conversion
        ../../gcc/cp/call.c:2108
0x6669df build_converted_constant_expr_internal
        ../../gcc/cp/call.c:4369
0x6e5289 build_noexcept_spec(tree_node*, int)
        ../../gcc/cp/except.c:1234
0x775ce9 maybe_instantiate_noexcept(tree_node*, int)
        ../../gcc/cp/pt.c:25545
0x7759f8 maybe_instantiate_noexcept(tree_node*, int)
        ../../gcc/cp/pt.c:25481
0x79d235 trait_expr_value
        ../../gcc/cp/semantics.c:10246
0x7a7c6a finish_trait_expr(unsigned int, cp_trait_kind, tree_node*, tree_node*)
        ../../gcc/cp/semantics.c:10449
0x748dd7 cp_parser_trait_expr
        ../../gcc/cp/parser.c:10749
0x73f58c cp_parser_primary_expression
        ../../gcc/cp/parser.c:5777
0x741b75 cp_parser_postfix_expression
        ../../gcc/cp/parser.c:7491
0x751a35 cp_parser_unary_expression
        ../../gcc/cp/parser.c:8808
0x72b84f cp_parser_cast_expression
        ../../gcc/cp/parser.c:9712
0x72c082 cp_parser_binary_expression
        ../../gcc/cp/parser.c:9814

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

* [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
@ 2020-12-17 11:20 ` marxin at gcc dot gnu.org
  2020-12-17 15:00 ` mpolacek at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-17 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-17
             Status|UNCONFIRMED                 |NEW
            Summary|[10/11 Regression] ICE in   |[10/11 Regression] ICE in
                   |check_qualified_type, at    |check_qualified_type, at
                   |tree.c:6593                 |tree.c:6593 since
                   |                            |r10-1280-g78f7607db4c53f8c
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-1280-g78f7607db4c53f8c.

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

* [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
  2020-12-17 11:20 ` [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
@ 2020-12-17 15:00 ` mpolacek at gcc dot gnu.org
  2021-01-04 15:34 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-17 15:00 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |10.3
             Status|NEW                         |ASSIGNED

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

* [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
  2020-12-17 11:20 ` [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
  2020-12-17 15:00 ` mpolacek at gcc dot gnu.org
@ 2021-01-04 15:34 ` rguenth at gcc dot gnu.org
  2021-01-07 23:24 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-04 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-01-04 15:34 ` rguenth at gcc dot gnu.org
@ 2021-01-07 23:24 ` mpolacek at gcc dot gnu.org
  2021-01-19 20:40 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-07 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Modified valid code:

constexpr int b = false;
struct T {
  template <class> struct S
  { S () noexcept (b) {} };
  int a = __has_nothrow_constructor (S<int>);
};

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

* [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-01-07 23:24 ` mpolacek at gcc dot gnu.org
@ 2021-01-19 20:40 ` cvs-commit at gcc dot gnu.org
  2021-01-19 20:42 ` [Bug c++/98333] [10 " mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-19 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:c37f1d4081f5a19e39192d13e2a3acea13662e5a

commit r11-6799-gc37f1d4081f5a19e39192d13e2a3acea13662e5a
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Jan 8 15:48:41 2021 -0500

    c++: ICE when late parsing noexcept/NSDMI [PR98333]

    Since certain members of a class are a complete-class context
    [class.mem.general]p7, we delay their parsing untile the whole class has
    been parsed.  For instance, NSDMIs and noexcept-specifiers.  The order
    in which we perform this delayed parsing matters; we were first parsing
    NSDMIs and only they did we parse noexcept-specifiers.   That turns out
    to be wrong: since NSDMIs may use noexcept-specifiers, we must process
    noexcept-specifiers first.  Otherwise we'll ICE in code that doesn't
    expect to see DEFERRED_PARSE.

    This doesn't just shift the problem, noexcept-specifiers can use members
    with a NSDMI just fine, and I've also tested a similar test with this
    member function:

      bool f() { return __has_nothrow_constructor (S<true>); }

    and that compiled fine too.

    gcc/cp/ChangeLog:

            PR c++/98333
            * parser.c (cp_parser_class_specifier_1): Perform late-parsing
            of NSDMIs before late-parsing of noexcept-specifiers.

    gcc/testsuite/ChangeLog:

            PR c++/98333
            * g++.dg/cpp0x/noexcept62.C: New test.

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

* [Bug c++/98333] [10 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-01-19 20:40 ` cvs-commit at gcc dot gnu.org
@ 2021-01-19 20:42 ` mpolacek at gcc dot gnu.org
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-19 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression] ICE in   |[10 Regression] ICE in
                   |check_qualified_type, at    |check_qualified_type, at
                   |tree.c:6593 since           |tree.c:6593 since
                   |r10-1280-g78f7607db4c53f8c  |r10-1280-g78f7607db4c53f8c

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed on trunk so far.

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

* [Bug c++/98333] [10 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-01-19 20:42 ` [Bug c++/98333] [10 " mpolacek at gcc dot gnu.org
@ 2021-04-08 12:02 ` rguenth at gcc dot gnu.org
  2021-04-09 22:25 ` cvs-commit at gcc dot gnu.org
  2021-04-09 22:27 ` mpolacek at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.3                        |10.4

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.

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

* [Bug c++/98333] [10 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
@ 2021-04-09 22:25 ` cvs-commit at gcc dot gnu.org
  2021-04-09 22:27 ` mpolacek at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-09 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:3bb551c6751304fb2d51cc8569f066dd8a9090e2

commit r10-9682-g3bb551c6751304fb2d51cc8569f066dd8a9090e2
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Jan 8 15:48:41 2021 -0500

    c++: ICE when late parsing noexcept/NSDMI [PR98333]

    Since certain members of a class are a complete-class context
    [class.mem.general]p7, we delay their parsing untile the whole class has
    been parsed.  For instance, NSDMIs and noexcept-specifiers.  The order
    in which we perform this delayed parsing matters; we were first parsing
    NSDMIs and only they did we parse noexcept-specifiers.   That turns out
    to be wrong: since NSDMIs may use noexcept-specifiers, we must process
    noexcept-specifiers first.  Otherwise we'll ICE in code that doesn't
    expect to see DEFERRED_PARSE.

    This doesn't just shift the problem, noexcept-specifiers can use members
    with a NSDMI just fine, and I've also tested a similar test with this
    member function:

      bool f() { return __has_nothrow_constructor (S<true>); }

    and that compiled fine too.

    gcc/cp/ChangeLog:

            PR c++/98333
            * parser.c (cp_parser_class_specifier_1): Perform late-parsing
            of NSDMIs before late-parsing of noexcept-specifiers.

    gcc/testsuite/ChangeLog:

            PR c++/98333
            * g++.dg/cpp0x/noexcept62.C: New test.

    (cherry picked from commit c37f1d4081f5a19e39192d13e2a3acea13662e5a)

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

* [Bug c++/98333] [10 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c
  2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-04-09 22:25 ` cvs-commit at gcc dot gnu.org
@ 2021-04-09 22:27 ` mpolacek at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-09 22:27 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed for GCC 10.4/11.

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

end of thread, other threads:[~2021-04-09 22:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 18:40 [Bug c++/98333] New: [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 gscfq@t-online.de
2020-12-17 11:20 ` [Bug c++/98333] [10/11 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
2020-12-17 15:00 ` mpolacek at gcc dot gnu.org
2021-01-04 15:34 ` rguenth at gcc dot gnu.org
2021-01-07 23:24 ` mpolacek at gcc dot gnu.org
2021-01-19 20:40 ` cvs-commit at gcc dot gnu.org
2021-01-19 20:42 ` [Bug c++/98333] [10 " mpolacek at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-09 22:25 ` cvs-commit at gcc dot gnu.org
2021-04-09 22:27 ` mpolacek 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).