http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58510
Bug ID: 58510 Summary: [4.9 regression] [c++0x] ICE with multiple non-static data initializations in union Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet (compiled with "-std=c++0x") triggers an ICE on trunk: ======================== void foo() { union { int i = 0; char c = 0; }; } ======================== bug.cc: In function 'void foo()': bug.cc:4:3: error: multiple fields in union 'foo()::<anonymous union>' initialized { ^ bug.cc: In constructor 'constexpr foo()::<anonymous union>::<constructor>()': bug.cc:4:3: error: initializations for multiple members of 'foo()::<anonymous union>' bug.cc: In function 'void foo()': bug.cc:7:4: note: synthesized method 'constexpr foo()::<anonymous union>::<constructor>()' first required here }; ^ bug.cc:7:4: internal compiler error: in complete_ctor_at_level_p, at expr.c:5650 0x89a301 complete_ctor_at_level_p(tree_node const*, long, tree_node const*) ../../gcc/gcc/expr.c:5650 0x89a68e categorize_ctor_elements_1 ../../gcc/gcc/expr.c:5602 0x9684b6 gimplify_init_constructor ../../gcc/gcc/gimplify.c:3966 0x96993e gimplify_modify_expr_rhs ../../gcc/gcc/gimplify.c:4518 0x969cad gimplify_modify_expr ../../gcc/gcc/gimplify.c:4834 0x95e07b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:7322 0x961ef6 gimplify_stmt(tree_node**, gimple_statement_d**) ../../gcc/gcc/gimplify.c:5699 0x95f987 gimplify_and_add ../../gcc/gcc/gimplify.c:329 0x95f987 gimplify_decl_expr ../../gcc/gcc/gimplify.c:1472 0x95f987 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:7489 0x961ef6 gimplify_stmt(tree_node**, gimple_statement_d**) ../../gcc/gcc/gimplify.c:5699 0x95eccf gimplify_cleanup_point_expr ../../gcc/gcc/gimplify.c:5475 0x95eccf gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:7659 0x961ef6 gimplify_stmt(tree_node**, gimple_statement_d**) ../../gcc/gcc/gimplify.c:5699 0x962bb1 gimplify_bind_expr ../../gcc/gcc/gimplify.c:1213 0x95e73f gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:7493 0x961ef6 gimplify_stmt(tree_node**, gimple_statement_d**) ../../gcc/gcc/gimplify.c:5699 0x963541 gimplify_body(tree_node*, bool) ../../gcc/gcc/gimplify.c:8356 0x9639f6 gimplify_function_tree(tree_node*) ../../gcc/gcc/gimplify.c:8488 0x7fa9d7 analyze_function ../../gcc/gcc/cgraphunit.c:636 Please submit a full bug report, [etc.]