https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71266
Bug ID: 71266 Summary: gcc ICE on x86_64-linux-gnu in "store_parm_decls_oldstyle" Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following invalid code causes an ICE when compiled with the current gcc trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. It appears to be a 7 regression. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 7.0.0 20160524 (experimental) [trunk revision 236651] (GCC) $ gcc-trunk abc.c abc.c:1:8: warning: return type defaults to ‘int’ [-Wimplicit-int] extern fn1 ( a ) enum b { a } ; { } ^~~ abc.c: In function ‘fn1’: abc.c:1:18: warning: empty declaration extern fn1 ( a ) enum b { a } ; { } ^~~~ abc.c:1:27: error: ‘a’ declared as a non-parameter extern fn1 ( a ) enum b { a } ; { } ^ abc.c:1:27: internal compiler error: tree check: expected parm_decl, have const_decl in store_parm_decls_oldstyle, at c/c-decl.c:8826 0xe2fc0c tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9753 0x672678 tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/gcc/tree.h:3030 0x672678 store_parm_decls_oldstyle ../../gcc/gcc/c/c-decl.c:8826 0x672678 store_parm_decls() ../../gcc/gcc/c/c-decl.c:8905 0x6c7e27 c_parser_declaration_or_fndef ../../gcc/gcc/c/c-parser.c:2095 0x6d37bd c_parser_external_declaration ../../gcc/gcc/c/c-parser.c:1549 0x6d41e9 c_parser_translation_unit ../../gcc/gcc/c/c-parser.c:1430 0x6d41e9 c_parse_file() ../../gcc/gcc/c/c-parser.c:17914 0x736a12 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1064 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ cat abc.c extern fn1 ( a ) enum b { a } ; { }