https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118897
Bug ID: 118897 Summary: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in categorize_ctor_elements_1, at expr.cc:7247 Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bic60176 at gmail dot com Target Milestone: --- Created attachment 60512 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60512&action=edit testcase Compiler Explorer: https://godbolt.org/z/a13fjbqP7 console: <source>: In function 'foo': <source>:27:5: error: conflicting types for 'y'; have 'L' {aka 'long long unsigned int'} 27 | L y = z; return y; | ^ <source>:15:5: note: previous definition of 'y' with type 'B' {aka '__vector(16) unsigned char'} 15 | B y = ((union { | ^ <source>:25:15: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in categorize_ctor_elements_1, at expr.cc:7247 21 | A z = ((union { | ~~~~~~~~~ 22 | B a; | ~~~~ 23 | A b[2]; | ~~~~~~~ 24 | })y) | ~~~~ 25 | .b[0] + | ~~^~~ 0x25f34a5 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x260a576 internal_error(char const*, ...) ???:0 0x8f3d53 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ???:0 0xde6132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde581b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde59f2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde5c8e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde6132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde9aba gimplify_stmt(tree_node**, gimple**) ???:0 0xde7aee gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde9aba gimplify_stmt(tree_node**, gimple**) ???:0 0xde6f8b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xde9aba gimplify_stmt(tree_node**, gimple**) ???:0 0xde78dc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xdefe16 gimplify_body(tree_node*, bool) ???:0 0xdf02dc gimplify_function_tree(tree_node*) ???:0 0xc051b7 cgraph_node::analyze() ???:0 0xc08531 symbol_table::finalize_compilation_unit() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Compiler returned: 1