https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96596
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-08-25 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Declaring any built-in that takes no arguments with an array argument that depends on a undefined symbol triggers the ICE. It doesn't appear to be a regression as I can reproduce the ICE going all the way back to GCC 4.1 with our builds. Although GCC releases on Godbolt don't show an ICE so maybe it's related to internal consistency checking. $ gcc -S pr96596.c pr96596.c:1:26: error: ‘foo’ undeclared here (not in a function) 1 | void __builtin_trap (int[foo]); | ^~~ pr96596.c:1:1: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in match_builtin_function_types, at c/c-decl.c:1715 1 | void __builtin_trap (int[foo]); | ^~~~ 0x16ed3f1 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) /src/gcc/master/gcc/tree.c:9764 0x91d1e7 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) /src/gcc/master/gcc/tree.h:3418 0x925d36 match_builtin_function_types /src/gcc/master/gcc/c/c-decl.c:1715 0x926b91 diagnose_mismatched_decls /src/gcc/master/gcc/c/c-decl.c:1994 0x92bc2a duplicate_decls /src/gcc/master/gcc/c/c-decl.c:2936 0x92c661 pushdecl(tree_node*) /src/gcc/master/gcc/c/c-decl.c:3129 0x9318e6 start_decl(c_declarator*, c_declspecs*, bool, tree_node*) /src/gcc/master/gcc/c/c-decl.c:5201 0x9a7a00 c_parser_declaration_or_fndef /src/gcc/master/gcc/c/c-parser.c:2299 0x9a664e c_parser_external_declaration /src/gcc/master/gcc/c/c-parser.c:1773 0x9a616f c_parser_translation_unit /src/gcc/master/gcc/c/c-parser.c:1646 0x9e4875 c_parse_file() /src/gcc/master/gcc/c/c-parser.c:21819 0xa7247b c_common_parse_file() /src/gcc/master/gcc/c-family/c-opts.c:1188 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.