https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114619
Bug ID: 114619
Summary: [14 regression] ICE with -fno-elide-constructors in
C++14 mode for non-constant initializer in array new
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mital at mitalashok dot co.uk
Target Milestone: ---
<https://godbolt.org/z/bc551qd51>:
struct X {
/*constexpr*/ X(const X&) {}
};
extern X x;
int main() {
new X[1]{x};
}
Compiled with `-std=c++14 -fno-elide-constructors` gives an internal compiler
error:
test.cpp: In function ‘int main()’:
test.cpp:8:14: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.cc:904
8 | new X[1]{x};
| ^
0x781b7d cp_gimplify_expr(tree_node**, gimple**, gimple**)
./gcc/gcc/cp/cp-gimplify.cc:904
0x104c159 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:17788
0x10577ef gimplify_addr_expr
./gcc/gcc/gimplify.cc:6910
0x104dca0 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:17929
0x105c9b3 gimplify_expr
./gcc/gcc/gimplify.cc:18951
0x105c9b3 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
./gcc/gcc/gimplify.cc:3778
0x105d599 gimplify_call_expr
./gcc/gcc/gimplify.cc:4063
0x104d280 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:17851
0x10504ba gimplify_stmt(tree_node**, gimple**)
./gcc/gcc/gimplify.cc:7576
0x104e3ab gimplify_statement_list
./gcc/gcc/gimplify.cc:2249
0x104e3ab gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:18327
0x105eaf7 gimplify_stmt(tree_node**, gimple**)
./gcc/gcc/gimplify.cc:7576
0x105eaf7 gimplify_compound_expr
./gcc/gcc/gimplify.cc:6761
0x105eba1 gimplify_compound_expr
./gcc/gcc/gimplify.cc:6759
0x104d440 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:17872
0x104d157 gimplify_stmt(tree_node**, gimple**)
./gcc/gcc/gimplify.cc:7576
0x104d157 gimplify_cleanup_point_expr
./gcc/gcc/gimplify.cc:7314
0x104d157 gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
./gcc/gcc/gimplify.cc:18275
0x10504ba gimplify_stmt(tree_node**, gimple**)
./gcc/gcc/gimplify.cc:7576
0x104e3ab gimplify_statement_list
./gcc/gcc/gimplify.cc:2249
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
git bisect shows this starts happening with
6ffbf87ca66f4ed9cd79cff675fabe2109e46e85