https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98198
Bug ID: 98198 Summary: [11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in decl_or_type_attrs Product: gcc Version: 11.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: --- $ cat test-6951.c static inline void sub_1 ( ) { struct struct_1 var_9 , var_10 } static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ; -------------------------------------------------------------------------------- $ gcc-11 --version gcc (GCC) 11.0.0 20201129 (experimental) Copyright (C) 2020 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. -------------------------------------------------------------------------------- $ gcc-11 test-6951.c test-6951.c: In function ‘sub_1’: test-6951.c:3:25: error: storage size of ‘var_9’ isn’t known 3 | struct struct_1 var_9 , var_10 | ^~~~~ test-6951.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘}’ token 4 | } | ^ test-6951.c:6:1: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in decl_or_type_attrs, at c-family/c-attribs.c:775 6 | static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ; | ^~~~~~ 0x753c11 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-11-20201129/gcc/tree.c:9860 0x642f30 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-11-20201129/gcc/tree.h:3454 0x642f30 decl_or_type_attrs ../../gcc-11-20201129/gcc/c-family/c-attribs.c:775 0x642f30 validate_attr_args ../../gcc-11-20201129/gcc/c-family/c-attribs.c:803 0x90691d validate_attr_arg ../../gcc-11-20201129/gcc/c-family/c-attribs.c:889 0x90691d handle_section_attribute ../../gcc-11-20201129/gcc/c-family/c-attribs.c:2132 0x80d0dc decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../gcc-11-20201129/gcc/attribs.c:723 0x8295f2 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, unsigned int*) ../../gcc-11-20201129/gcc/c/c-decl.c:5188 0x884e32 c_parser_declaration_or_fndef ../../gcc-11-20201129/gcc/c/c-parser.c:2302 0x867ef0 c_parser_compound_statement_nostart ../../gcc-11-20201129/gcc/c/c-parser.c:5700 0x8848f5 c_parser_compound_statement ../../gcc-11-20201129/gcc/c/c-parser.c:5597 0x886378 c_parser_declaration_or_fndef ../../gcc-11-20201129/gcc/c/c-parser.c:2539 0x88dbe3 c_parser_external_declaration ../../gcc-11-20201129/gcc/c/c-parser.c:1777 0x88e629 c_parser_translation_unit ../../gcc-11-20201129/gcc/c/c-parser.c:1650 0x88e629 c_parse_file() ../../gcc-11-20201129/gcc/c/c-parser.c:21877 0x8ebdfd c_common_parse_file() ../../gcc-11-20201129/gcc/c-family/c-opts.c:1198 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. -------------------------------------------------------------------------------- $ gcc-10 --version gcc (GCC) 10.2.1 20201128 Copyright (C) 2020 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. -------------------------------------------------------------------------------- $ gcc-10 test-6951.c test-6951.c: In function ‘sub_1’: test-6951.c:3:18: error: storage size of ‘var_9’ isn’t known 3 | struct struct_1 var_9 , var_10 | ^~~~~ test-6951.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘}’ token 4 | } | ^ test-6951.c:6:1: error: expected declaration or statement at end of input 6 | static int var_9[1] __attribute__ ( ( section ( ".data" ) ) ) ; | ^~~~~~