https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79796
Bug ID: 79796 Summary: [5/6/7 Regression] ICE with NSDMI and this pointer Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following valid code snippet (compiled with -std=c++1y) triggers an ICE since GCC 5.1.0: ===================== struct A { A* p = this; }; void foo() { A a; a = A({}); } ===================== bug.cc: In function 'void foo()': bug.cc:9:5: internal compiler error: in gimplify_expr, at gimplify.c:11950 a = A({}); ~~^~~~~~~ 0xaeacfc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11950 0xae80e0 gimplify_addr_expr ../../gcc/gcc/gimplify.c:5859 0xae80e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11238 0xaf17c0 gimplify_init_ctor_preeval ../../gcc/gcc/gimplify.c:4241 0xaf1778 gimplify_init_ctor_preeval ../../gcc/gcc/gimplify.c:4227 0xaf225c gimplify_init_constructor ../../gcc/gcc/gimplify.c:4796 0xaf3096 gimplify_modify_expr_rhs ../../gcc/gcc/gimplify.c:5082 0xaf9dd0 gimplify_modify_expr ../../gcc/gcc/gimplify.c:5417 0xae897c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11191 0xaeb8d8 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6478 0xae7a7a gimplify_cleanup_point_expr ../../gcc/gcc/gimplify.c:6230 0xae7a7a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11567 0xaeb8d8 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6478 0xae71cb gimplify_statement_list ../../gcc/gcc/gimplify.c:1716 0xae71cb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11619 0xaeb8d8 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6478 0xaec9a8 gimplify_bind_expr ../../gcc/gcc/gimplify.c:1290 0xae7b7a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11391 0xaeb8d8 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6478 0xaed911 gimplify_body(tree_node*, bool) ../../gcc/gcc/gimplify.c:12388 Please submit a full bug report, [etc.]