public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527
@ 2020-12-16 18:39 gscfq@t-online.de
  2020-12-17 11:18 ` [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-12-16 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98332
           Summary: [10/11 Regression] ICE in unshare_constructor, at
                    cp/constexpr.c:1527
           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 20190609 and 20190616 :


$ cat z1.cc
struct S { int a = 2147483647 + 1; };
struct { S b[2][1][1][1]; } c;


$ cat z2.cc
#include <limits.h>
struct S { int a = INT_MAX + 1; };
struct { S b[2][1][1][1]; } c;


$ g++-11-20201213 -c z1.cc
z1.cc:1:31: warning: integer overflow in expression of type 'int' results in
'-2147483648' [-Woverflow]
    1 | struct S { int a = 2147483647 + 1; };
      |                    ~~~~~~~~~~~^~~
z1.cc:2:29:   in 'constexpr' expansion of 'c.<unnamed struct>::<constructor>()'
z1.cc:2:29: internal compiler error: Segmentation fault
    2 | struct { S b[2][1][1][1]; } c;
      |                             ^
0xc8f5ff crash_signal
        ../../gcc/toplev.c:327
0x67c3e8 unshare_constructor(tree_node*)
        ../../gcc/cp/constexpr.c:1527
0x68a51a cxx_eval_vec_init_1
        ../../gcc/cp/constexpr.c:4575
0x681d76 cxx_eval_vec_init
        ../../gcc/cp/constexpr.c:4599
0x681d76 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6584
0x6883c8 cxx_eval_store_expression
        ../../gcc/cp/constexpr.c:5406
0x6811ca cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6226
0x680737 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6609
0x680b8c cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6284
0x680cde cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6295
0x680d70 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6788
0x67f58f cxx_eval_call_expression
        ../../gcc/cp/constexpr.c:2701
0x680f5a cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:6117
0x683eab cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.c:7126
0x686e7f maybe_constant_init_1
        ../../gcc/cp/constexpr.c:7578
0x6ea7b6 expand_default_init
        ../../gcc/cp/init.c:1998
0x6ea7b6 expand_aggr_init_1
        ../../gcc/cp/init.c:2101
0x6ec475 build_aggr_init(tree_node*, tree_node*, int, int)
        ../../gcc/cp/init.c:1835
0x6cb20d build_aggr_init_full_exprs
        ../../gcc/cp/decl.c:6803
0x6cb20d check_initializer
        ../../gcc/cp/decl.c:6964

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
@ 2020-12-17 11:18 ` marxin at gcc dot gnu.org
  2020-12-22 21:17 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-17 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|[10/11 Regression] ICE in   |[10/11 Regression] ICE in
                   |unshare_constructor, at     |unshare_constructor, at
                   |cp/constexpr.c:1527         |cp/constexpr.c:1527 since
                   |                            |r6-7607-g52228180f1e50cbb
   Last reconfirmed|                            |2020-12-17
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r6-7607-g52228180f1e50cbb.

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
  2020-12-17 11:18 ` [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb marxin at gcc dot gnu.org
@ 2020-12-22 21:17 ` jason at gcc dot gnu.org
  2020-12-23 21:40 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2020-12-22 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Started with r6-7607-g52228180f1e50cbb.

Rather, with r10-986-g9b9eb42a4168c342e5cd71b13d21e63ba7e1b7ab.

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
  2020-12-17 11:18 ` [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb marxin at gcc dot gnu.org
  2020-12-22 21:17 ` jason at gcc dot gnu.org
@ 2020-12-23 21:40 ` cvs-commit at gcc dot gnu.org
  2020-12-23 22:11 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-23 21:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:6b7d53a25933f4aed71d6d5134e971bd995f8973

commit r11-6320-g6b7d53a25933f4aed71d6d5134e971bd995f8973
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Dec 22 16:40:37 2020 -0500

    c++: Fix constexpr array ICE [PR98332]

    The element initializer was non-constant, so its CONSTRUCTOR element ended
    up NULL, so unshare_constructor crashed trying to look at it.  This patch
    fixes this in two places: First, by returning when we see a non-constant
    initializer; second, by not crashing on NULL.

    gcc/cp/ChangeLog:

            PR c++/98332
            * constexpr.c (unshare_constructor): Check for NULL.
            (cxx_eval_vec_init_1): Always exit early if non-constant.

    gcc/testsuite/ChangeLog:

            PR c++/98332
            * g++.dg/cpp0x/constexpr-overflow3.C: New test.

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-12-23 21:40 ` cvs-commit at gcc dot gnu.org
@ 2020-12-23 22:11 ` cvs-commit at gcc dot gnu.org
  2020-12-29  3:25 ` asolokha at gmx dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-23 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:f5cea9c5c4f8cce36963973e432a8575ef9ffd63

commit r10-9169-gf5cea9c5c4f8cce36963973e432a8575ef9ffd63
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Dec 22 16:40:37 2020 -0500

    c++: Fix constexpr array ICE [PR98332]

    The element initializer was non-constant, so its CONSTRUCTOR element ended
    up NULL, so unshare_constructor crashed trying to look at it.  This patch
    fixes this in two places: First, by returning when we see a non-constant
    initializer; second, by not crashing on NULL.

    gcc/cp/ChangeLog:

            PR c++/98332
            * constexpr.c (unshare_constructor): Check for NULL.
            (cxx_eval_vec_init_1): Always exit early if non-constant.

    gcc/testsuite/ChangeLog:

            PR c++/98332
            * g++.dg/cpp0x/constexpr-overflow3.C: New test.

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-12-23 22:11 ` cvs-commit at gcc dot gnu.org
@ 2020-12-29  3:25 ` asolokha at gmx dot com
  2021-01-04  7:07 ` marxin at gcc dot gnu.org
  2021-09-11  6:40 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2020-12-29  3:25 UTC (permalink / raw)
  To: gcc-bugs

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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asolokha at gmx dot com

--- Comment #5 from Arseny Solokha <asolokha at gmx dot com> ---
Should this PR be closed now, or are there other fixes pending?

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-12-29  3:25 ` asolokha at gmx dot com
@ 2021-01-04  7:07 ` marxin at gcc dot gnu.org
  2021-09-11  6:40 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-04  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

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

* [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb
  2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-01-04  7:07 ` marxin at gcc dot gnu.org
@ 2021-09-11  6:40 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-11  6:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |10.4

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

end of thread, other threads:[~2021-09-11  6:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 18:39 [Bug c++/98332] New: [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 gscfq@t-online.de
2020-12-17 11:18 ` [Bug c++/98332] [10/11 Regression] ICE in unshare_constructor, at cp/constexpr.c:1527 since r6-7607-g52228180f1e50cbb marxin at gcc dot gnu.org
2020-12-22 21:17 ` jason at gcc dot gnu.org
2020-12-23 21:40 ` cvs-commit at gcc dot gnu.org
2020-12-23 22:11 ` cvs-commit at gcc dot gnu.org
2020-12-29  3:25 ` asolokha at gmx dot com
2021-01-04  7:07 ` marxin at gcc dot gnu.org
2021-09-11  6:40 ` pinskia 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).