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: gs...@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