https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109619
Bug ID: 109619 Summary: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc Product: gcc Version: 13.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: --- $ gcc --version gcc (GCC) 13.0.1 20230219 (experimental) Copyright (C) 2023 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. -------------------------------- $ cat 4.c void foo(void *a1, const void *a2, long unsigned int a3) { void *x = __builtin_memcpy(a1, a2, a3); int *a3 = __builtin_memmove(a1, a2, a3); } -------------------------------- $ gcc 4.c 4.c: In function ‘foo’: 4.c:5:8: error: ‘a3’ redeclared as different kind of symbol 5 | int *a3 = __builtin_memmove(a1, a2, a3); | ^~ 4.c:2:54: note: previous definition of ‘a3’ with type ‘long unsigned int’ 2 | void foo(void *a1, const void *a2, long unsigned int a3) | ~~~~~~~~~~~~~~~~~~^~ 4.c:4:13: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc:1800 4 | void *x = __builtin_memcpy(a1, a2, a3); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x840637 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-13-20230219/gcc/tree.cc:8959 0x776846 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-13-20230219/gcc/tree.h:3653 0x776846 fold_const_call_1 ../../gcc-13-20230219/gcc/fold-const-call.cc:1800 0x776846 fold_const_call(combined_fn, tree_node*, tree_node*, tree_node*, tree_node*) ../../gcc-13-20230219/gcc/fold-const-call.cc:1903 0xa66a98 fold_builtin_3 ../../gcc-13-20230219/gcc/builtins.cc:9851 0xa66a98 fold_builtin_n ../../gcc-13-20230219/gcc/builtins.cc:9932 0xc97037 gimplify_call_expr ../../gcc-13-20230219/gcc/gimplify.cc:3684 0xc88500 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-13-20230219/gcc/gimplify.cc:16333 0xc9a465 gimplify_modify_expr ../../gcc-13-20230219/gcc/gimplify.cc:6153 0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-13-20230219/gcc/gimplify.cc:16361 0xc8a316 gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xc97d34 gimplify_and_add(tree_node*, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:492 0xc97d34 gimplify_decl_expr ../../gcc-13-20230219/gcc/gimplify.cc:1936 0xc88132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-13-20230219/gcc/gimplify.cc:16558 0xc8a316 gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xc88c38 gimplify_statement_list ../../gcc-13-20230219/gcc/gimplify.cc:2019 0xc88c38 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-13-20230219/gcc/gimplify.cc:16806 0xc8a316 gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xc8aa47 gimplify_bind_expr ../../gcc-13-20230219/gcc/gimplify.cc:1430 0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int) ../../gcc-13-20230219/gcc/gimplify.cc:16562 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.