https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80143
Bug ID: 80143 Summary: ICE on placement new in gimplify_init_ctor_eval, at gimplify.c:4436 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- GCC 5, 6, and 7 all crash on the following ill-formed test case. $ cat t.C && gcc -O2 -S -Wall -Wextra -Wpedantic t.C typedef __SIZE_TYPE__ size_t; void* operator new[](size_t, void *p) { return p; } void g (void*); void f () { typedef struct S { int a[2]; } S; char buf [sizeof (S)]; S *ps = (S*)buf; new (ps->a) int[]((int[]){ 1, 2 }); g (ps); } t.C: In function ‘void f()’: t.C:14:19: error: expected primary-expression before ‘]’ token new (ps->a) int[]((int[]){ 1, 2 }); ^ t.C:14:35: warning: ISO C++ forbids compound-literals [-Wpedantic] new (ps->a) int[]((int[]){ 1, 2 }); ^ t.C:14:36: error: parenthesized initializer in array new [-fpermissive] new (ps->a) int[]((int[]){ 1, 2 }); ^ t.C:14:36: internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4436 0xe11767 gimplify_init_ctor_eval /src/gcc/git/gcc/gimplify.c:4436 0xe129a3 gimplify_init_constructor /src/gcc/git/gcc/gimplify.c:4820 0xe13441 gimplify_modify_expr_rhs /src/gcc/git/gcc/gimplify.c:5082 0xe143b4 gimplify_modify_expr /src/gcc/git/gcc/gimplify.c:5418 0xe2f1c1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /src/gcc/git/gcc/gimplify.c:11199 0xe1867d gimplify_stmt(tree_node**, gimple**) /src/gcc/git/gcc/gimplify.c:6478 0xe17c66 gimplify_cleanup_point_expr /src/gcc/git/gcc/gimplify.c:6230 0xe309e7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /src/gcc/git/gcc/gimplify.c:11574 0xe1867d gimplify_stmt(tree_node**, gimple**) /src/gcc/git/gcc/gimplify.c:6478 0xe0777a gimplify_statement_list /src/gcc/git/gcc/gimplify.c:1716 0xe30d96 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /src/gcc/git/gcc/gimplify.c:11626 0xe1867d gimplify_stmt(tree_node**, gimple**) /src/gcc/git/gcc/gimplify.c:6478 0xe0385f gimplify_and_add(tree_node*, gimple**) /src/gcc/git/gcc/gimplify.c:435 0xe07688 gimplify_loop_expr /src/gcc/git/gcc/gimplify.c:1690 0xe2fea9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /src/gcc/git/gcc/gimplify.c:11402 0xe1867d gimplify_stmt(tree_node**, gimple**) /src/gcc/git/gcc/gimplify.c:6478 0xe0777a gimplify_statement_list /src/gcc/git/gcc/gimplify.c:1716 0xe30d96 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) /src/gcc/git/gcc/gimplify.c:11626 0xe1867d gimplify_stmt(tree_node**, gimple**) /src/gcc/git/gcc/gimplify.c:6478 0xe0777a gimplify_statement_list /src/gcc/git/gcc/gimplify.c:1716 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.