https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101196
Bug ID: 101196 Summary: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anbu1024.me at gmail dot com Target Milestone: --- $ cat 37.c extern int var[16]; void foo(int [x]); void bar(void) { void foo(int array[]); } void baz(void) { foo(var); } ------------------------------------------------------------------------------- $ gcc-sp12 --version gcc (GCC) 12.0.0 20210620 (experimental) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ------------------------------------------------------------------------------- $ gcc-sp12 37.c 37.c:4:15: error: ‘x’ undeclared here (not in a function) 4 | void foo(int [x]); | ^ 37.c: In function ‘baz’: 37.c:13:7: error: type of formal parameter 1 is incomplete 13 | foo(var); | ^~~ 37.c:13:3: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 13 | foo(var); | ^~~ 0x7a313c tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-12-20210620/gcc/tree.c:8734 0x6d5d8a tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-12-20210620/gcc/tree.h:3494 0x6d5d8a useless_type_conversion_p(tree_node*, tree_node*) ../../gcc-12-20210620/gcc/gimple-expr.c:259 0xbc1108 types_compatible_p ../../gcc-12-20210620/gcc/gimple-expr.h:67 0xbc1108 gimplify_addr_expr ../../gcc-12-20210620/gcc/gimplify.c:6234 0xbb9384 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-12-20210620/gcc/gimplify.c:14141 0xbc4dc4 gimplify_call_expr ../../gcc-12-20210620/gcc/gimplify.c:3454 0xbbacd4 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-12-20210620/gcc/gimplify.c:14066 0xbbc9f6 gimplify_stmt(tree_node**, gimple**) ../../gcc-12-20210620/gcc/gimplify.c:6865 0xbbd14d gimplify_bind_expr ../../gcc-12-20210620/gcc/gimplify.c:1426 0xbbacee gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-12-20210620/gcc/gimplify.c:14295 0xbd2229 gimplify_stmt(tree_node**, gimple**) ../../gcc-12-20210620/gcc/gimplify.c:6865 0xbd2229 gimplify_body(tree_node*, bool) ../../gcc-12-20210620/gcc/gimplify.c:15339 0xbd266d gimplify_function_tree(tree_node*) ../../gcc-12-20210620/gcc/gimplify.c:15493 0xa10bf7 cgraph_node::analyze() ../../gcc-12-20210620/gcc/cgraphunit.c:670 0xa135f7 analyze_functions ../../gcc-12-20210620/gcc/cgraphunit.c:1234 0xa1428d symbol_table::finalize_compilation_unit() ../../gcc-12-20210620/gcc/cgraphunit.c:2508 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. ------------------------------------------------------------------------------- $ gcc-sp11 --version gcc (GCC) 11.1.1 20210619 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ------------------------------------------------------------------------------- $ gcc-sp11 37.c 37.c:4:15: error: ‘x’ undeclared here (not in a function) 4 | void foo(int [x]); | ^ 37.c: In function ‘baz’: 37.c:13:7: error: type of formal parameter 1 is incomplete 13 | foo(var); | ^~~