https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120269
Bug ID: 120269 Summary: ICE: tree check: expected class type, have exceptional (error_mark) in c_parser_generic_selection, at c/c-parser.cc:9270 Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: rundongyang22 at m dot fudan.edu.cn Target Milestone: --- Created attachment 61421 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61421&action=edit C source file to reproduce the ICE ---------- GCC Version & System Type & Configure Option $ $CC -v Using built-in specs. COLLECT_GCC=/home/liuyu/Desktop/gcc-13/bin/gcc COLLECT_LTO_WRAPPER=/home/liuyu/Desktop/gcc-13/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-multilib --enable-languages=c,c++ --prefix=/home/liuyu/Desktop/bin Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.1.0 (GCC) ---------- Compiler Output $ $CC ./17917.c ./17917.c: In function ‘main’: ./17917.c:29:18: error: expected identifier or ‘(’ before ‘[’ token 29 | processes[i].running = false; | ^ ./17917.c:40:18: error: expected identifier or ‘(’ before ‘[’ token 40 | processes[i] = p; | ^ ./17917.c:45:13: error: expected expression before ‘processes’ 45 | if (processes[i].running) | ^~~~~~~~~ ./17917.c:22:30: error: expected expression before ‘,’ token 22 | #define check(r) _Generic((r),\ | ^~ 23 | Process: checkPrinter,\ | ./17917.c:46:13: note: in expansion of macro ‘check’ 46 | check(processes[i]); | ^~~~~ ./17917.c:22:30: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_parser_generic_selection, at c/c-parser.cc:9270 22 | #define check(r) _Generic((r),\ | ^~ 23 | Process: checkPrinter,\ | ./17917.c:46:13: note: in expansion of macro ‘check’ 46 | check(processes[i]); | ^~~~~ 0x19dcb2a tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/tree.cc:8931 0xc3ae27 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc/tree.h:3663 0xce59cc c_parser_generic_selection ../../gcc/c/c-parser.cc:9270 0xceb507 c_parser_postfix_expression ../../gcc/c/c-parser.cc:10790 0xce42a9 c_parser_unary_expression ../../gcc/c/c-parser.cc:8831 0xce345b c_parser_cast_expression ../../gcc/c/c-parser.cc:8672 0xce133e c_parser_binary_expression ../../gcc/c/c-parser.cc:8440 0xce08c2 c_parser_conditional_expression ../../gcc/c/c-parser.cc:8138 0xce04d2 c_parser_expr_no_commas ../../gcc/c/c-parser.cc:8052 0xced7e6 c_parser_expression ../../gcc/c/c-parser.cc:11379 0xcedb24 c_parser_expression_conv ../../gcc/c/c-parser.cc:11419 0xcdcce5 c_parser_statement_after_labels ../../gcc/c/c-parser.cc:6781 0xcdd0b3 c_parser_if_body ../../gcc/c/c-parser.cc:6887 0xcdd48f c_parser_if_statement ../../gcc/c/c-parser.cc:7011 0xcdc587 c_parser_statement_after_labels ../../gcc/c/c-parser.cc:6622 0xcdbc17 c_parser_compound_statement_nostart ../../gcc/c/c-parser.cc:6296 0xcdb4fa c_parser_compound_statement ../../gcc/c/c-parser.cc:6105 0xcdc4ea c_parser_statement_after_labels ../../gcc/c/c-parser.cc:6616 0xcdc3cf c_parser_statement ../../gcc/c/c-parser.cc:6587 0xcdcf43 c_parser_c99_block_statement ../../gcc/c/c-parser.cc:6846 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.