public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
@ 2022-04-12 17:25 gscfq@t-online.de
  2022-04-12 17:48 ` [Bug c++/105245] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2022-04-12 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105245
           Summary: [10/11/12 Regression] ICE in clear_no_implicit_zero,
                    in cp/constexpr.cc:1892
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started between 20210411 and 20210418,
with option -fno-elide-constructors plus -std=c++11 or -std=c++14
and file g++.dg/cpp1y/constexpr-empty2.C :


$ g++-9           -c constexpr-empty2.C -fno-elide-constructors -std=c++14
$ g++-12-20220410 -c constexpr-empty2.C -fno-elide-constructors -std=c++17
$
$ g++-12-20220410 -c constexpr-empty2.C -fno-elide-constructors -std=c++14
constexpr-empty2.C: In function 'constexpr int f()':
constexpr-empty2.C:22:10:   in 'constexpr' expansion of 'b2.C::C(b1)'
constexpr-empty2.C:22:10: internal compiler error: Segmentation fault
   22 |   C b2{b1};
      |          ^
0xda8c2f crash_signal
        ../../gcc/toplev.cc:322
0x6f902b clear_no_implicit_zero
        ../../gcc/cp/constexpr.cc:1892
0x6ff9db cxx_eval_call_expression
        ../../gcc/cp/constexpr.cc:2992
0x702388 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.cc:6713
0x705043 cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.cc:7822
0x70843f maybe_constant_init_1
        ../../gcc/cp/constexpr.cc:8285
0x76f8d5 expand_default_init
        ../../gcc/cp/init.cc:2204
0x76f8d5 expand_aggr_init_1
        ../../gcc/cp/init.cc:2309
0x771489 build_aggr_init(tree_node*, tree_node*, int, int)
        ../../gcc/cp/init.cc:2029
0x74f02d build_aggr_init_full_exprs
        ../../gcc/cp/decl.cc:7183
0x74f02d check_initializer
        ../../gcc/cp/decl.cc:7348
0x750360 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/cp/decl.cc:8379
0x8133ef cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22821
0x7f1502 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:15280
0x7f2da9 cp_parser_declaration_statement
        ../../gcc/cp/parser.cc:14361
0x7f33ab cp_parser_statement
        ../../gcc/cp/parser.cc:12446
0x7f42f4 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12850
0x7f43af cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12802
0x812578 cp_parser_function_body
        ../../gcc/cp/parser.cc:25060
0x812578 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25111

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

* [Bug c++/105245] [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
@ 2022-04-12 17:48 ` mpolacek at gcc dot gnu.org
  2022-04-12 17:50 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-04-12 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-04-12
   Target Milestone|---                         |10.4

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r11-8222-g35e8b38a91d9fb:

commit 35e8b38a91d9fb49a4759649576f15e76c129d99
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 16 17:37:07 2021 +0200

    c++: Fix empty base stores in cxx_eval_store_expression [PR100111]

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

* [Bug c++/105245] [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
  2022-04-12 17:48 ` [Bug c++/105245] " mpolacek at gcc dot gnu.org
@ 2022-04-12 17:50 ` mpolacek at gcc dot gnu.org
  2022-04-12 21:06 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-04-12 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
0x0000000000b5b5c9 in clear_no_implicit_zero (ctor=<constructor
0x7fffea4a4ed0>) at /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:1892
1892            if (TREE_CODE (e.value) == CONSTRUCTOR)
(gdb) p ctor
$3 = <constructor 0x7fffea4a4ed0>
(gdb) pge
{.b=}

that ctor doesn't look right...

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

* [Bug c++/105245] [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
  2022-04-12 17:48 ` [Bug c++/105245] " mpolacek at gcc dot gnu.org
  2022-04-12 17:50 ` mpolacek at gcc dot gnu.org
@ 2022-04-12 21:06 ` jason at gcc dot gnu.org
  2022-04-13 14:18 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2022-04-12 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

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

* [Bug c++/105245] [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-04-12 21:06 ` jason at gcc dot gnu.org
@ 2022-04-13 14:18 ` cvs-commit at gcc dot gnu.org
  2022-05-06 20:30 ` [Bug c++/105245] [10/11 " cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-13 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r12-8144-gec03862f809e544a9b7d28067e51597dc92a0244
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 12 17:46:59 2022 -0400

    c++: empty base constexpr -fno-elide-ctors [PR105245]

    The patch for 100111 extended our handling of empty base elision to the
case
    where the derived class has no other fields, but we still need to make sure
    that there's some initializer for the derived object.

            PR c++/105245
            PR c++/100111

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
            as needed in empty base handling.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1y/constexpr-empty2.C: Add -fno-elide-constructors.

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

* [Bug c++/105245] [10/11 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-04-13 14:18 ` cvs-commit at gcc dot gnu.org
@ 2022-05-06 20:30 ` cvs-commit at gcc dot gnu.org
  2022-05-12 20:13 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-06 20:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:967cdbe66296535fa496b88406a1125c8acaf6e2

commit r13-160-g967cdbe66296535fa496b88406a1125c8acaf6e2
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 12 17:46:59 2022 -0400

    c++: empty base constexpr adjustment [PR105245]

    While looking at PR105245 in stage 4, I wanted to reorganize the code a
bit,
    but it seemed prudent to defer that to stage 1.

            PR c++/105245
            PR c++/100111

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
            handling.

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

* [Bug c++/105245] [10/11 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-05-06 20:30 ` [Bug c++/105245] [10/11 " cvs-commit at gcc dot gnu.org
@ 2022-05-12 20:13 ` cvs-commit at gcc dot gnu.org
  2022-05-12 21:15 ` [Bug c++/105245] [10 " cvs-commit at gcc dot gnu.org
  2022-05-12 21:36 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-12 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

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

commit r11-9984-gfe81f5bd3c3e764d1355eda3e44e37cec99cd23c
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 12 17:46:59 2022 -0400

    c++: empty base constexpr -fno-elide-ctors [PR105245]

    The patch for 100111 extended our handling of empty base elision to the
case
    where the derived class has no other fields, but we still need to make sure
    that there's some initializer for the derived object.

            PR c++/105245
            PR c++/100111

    gcc/cp/ChangeLog:

            * constexpr.c (cxx_eval_store_expression): Build a CONSTRUCTOR
            as needed in empty base handling.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1y/constexpr-empty2.C: Add -fno-elide-constructors.

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

* [Bug c++/105245] [10 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-05-12 20:13 ` cvs-commit at gcc dot gnu.org
@ 2022-05-12 21:15 ` cvs-commit at gcc dot gnu.org
  2022-05-12 21:36 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-12 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:6c7905a9f10d28dfd27ddf21d3bf38a3e261ee10

commit r10-10722-g6c7905a9f10d28dfd27ddf21d3bf38a3e261ee10
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 12 17:46:59 2022 -0400

    c++: empty base constexpr -fno-elide-ctors [PR105245]

    The patch for 100111 extended our handling of empty base elision to the
case
    where the derived class has no other fields, but we still need to make sure
    that there's some initializer for the derived object.

            PR c++/105245
            PR c++/100111

    gcc/cp/ChangeLog:

            * constexpr.c (cxx_eval_store_expression): Build a CONSTRUCTOR
            as needed in empty base handling.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1y/constexpr-empty2.C: Add -fno-elide-constructors.

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

* [Bug c++/105245] [10 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892
  2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2022-05-12 21:15 ` [Bug c++/105245] [10 " cvs-commit at gcc dot gnu.org
@ 2022-05-12 21:36 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-12 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 10.4/11.3/12.

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

end of thread, other threads:[~2022-05-12 21:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 17:25 [Bug c++/105245] New: [10/11/12 Regression] ICE in clear_no_implicit_zero, in cp/constexpr.cc:1892 gscfq@t-online.de
2022-04-12 17:48 ` [Bug c++/105245] " mpolacek at gcc dot gnu.org
2022-04-12 17:50 ` mpolacek at gcc dot gnu.org
2022-04-12 21:06 ` jason at gcc dot gnu.org
2022-04-13 14:18 ` cvs-commit at gcc dot gnu.org
2022-05-06 20:30 ` [Bug c++/105245] [10/11 " cvs-commit at gcc dot gnu.org
2022-05-12 20:13 ` cvs-commit at gcc dot gnu.org
2022-05-12 21:15 ` [Bug c++/105245] [10 " cvs-commit at gcc dot gnu.org
2022-05-12 21:36 ` jason 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).