https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85112
Bug ID: 85112 Summary: [8 Regression] ICE with invalid constexpr Product: gcc Version: unknown Status: UNCONFIRMED Keywords: error-recovery, ice-on-invalid-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 invalid code snippet triggers an ICE on trunk: =============================== struct A { int m; int n : 4; }; int i; void foo() { constexpr int j = i; A a; a.n = j; } =============================== bug.cc: In function 'void foo()': bug.cc:11:21: error: the value of 'i' is not usable in a constant expression constexpr int j = i; ^ bug.cc:7:5: note: 'int i' is not const int i; ^ bug.cc:13:7: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:86 a.n = j; ~~~~^~~ 0x78cafe tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.c:9372 0x6ce53d tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc/gcc/tree.h:3258 0x6ce53d useless_type_conversion_p(tree_node*, tree_node*) ../../gcc/gcc/gimple-expr.c:86 0x10bc78a tree_ssa_strip_useless_type_conversions(tree_node*) ../../gcc/gcc/tree-ssa.c:1253 0xc645a7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11330 0xc74513 gimplify_modify_expr ../../gcc/gcc/gimplify.c:5625 0xc65c10 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11434 0xc68d16 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6658 0xc66bb2 gimplify_cleanup_point_expr ../../gcc/gcc/gimplify.c:6399 0xc66bb2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11811 0xc68d16 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6658 0xc664bb gimplify_statement_list ../../gcc/gcc/gimplify.c:1764 0xc664bb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11863 0xc68d16 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6658 0xc69a3c gimplify_bind_expr ../../gcc/gcc/gimplify.c:1331 0xc66b2a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:11635 0xc68d16 gimplify_stmt(tree_node**, gimple**) ../../gcc/gcc/gimplify.c:6658 0xc6a70a gimplify_body(tree_node*, bool) ../../gcc/gcc/gimplify.c:12635 0xc6ac04 gimplify_function_tree(tree_node*) ../../gcc/gcc/gimplify.c:12800 0xaef847 cgraph_node::analyze() ../../gcc/gcc/cgraphunit.c:670 Please submit a full bug report, [etc.] The regression was introduced between 2017-06-06 and 2017-06-10.