https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115644
Bug ID: 115644 Summary: [gcc][trunk] ICE if redeclare a variable with different type Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: 141242068 at smail dot nju.edu.cn Target Milestone: --- Quick verification link: https://gcc.godbolt.org/z/fdY8KqhK6 The testing program: ``` void foo () { int p[5]; int v = *p; int *p = 0; } ``` Compiling this program using gcc-trunk will trigger crash, and dump stacks as follows: ``` 0x23be10c internal_error(char const*, ...) ???:0 0x8948df tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ???:0 0xd120d0 gimple_fold_indirect_ref(tree_node*) ???:0 0xd5b8f7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xd5f06a gimplify_stmt(tree_node**, gimple**) ???:0 0xd5c472 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xd5f06a gimplify_stmt(tree_node**, gimple**) ???:0 0xd5c75b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xd5f06a gimplify_stmt(tree_node**, gimple**) ???:0 0xd5bf2a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ???:0 0xd651b3 gimplify_body(tree_node*, bool) ???:0 0xd655f9 gimplify_function_tree(tree_node*) ???:0 0xb87377 cgraph_node::analyze() ???:0 0xb8a6d1 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. ```