https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705

            Bug ID: 94705
           Summary: [10 Regression] internal compiler error: tree check:
                    expected class ‘type’, have ‘exceptional’ (error_mark)
                    in diag_attr_exclusions, at attribs.c:396
           Product: gcc
           Version: 10.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-10 --version
gcc (GCC) 10.0.1 20200419 (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.

--------------------------------------------------------------------------------

$ cat test.c 
void sub_0 (void * arg_0){}

int sub_1 ( unsigned arg_0 ) { 
        if ( sub_0 ( sub_2 ) ) 
        { 
                ; 
        } 

        void __attribute__ ( ( noinline ) ) sub_2 ( int arg_0 );
}

--------------------------------------------------------------------------------

$ gcc-10 test.c 
test.c: In function ‘sub_1’:
test.c:4:15: error: ‘sub_2’ undeclared (first use in this function); did you
mean ‘sub_1’?
    4 |  if ( sub_0 ( sub_2 ) )
      |               ^~~~~
      |               sub_1
test.c:4:15: note: each undeclared identifier is reported only once for each
function it appears in
test.c:9:2: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396
    9 |  void __attribute__ ( ( noinline ) ) sub_2 ( int arg_0 );
      |  ^~~~
0x731f2f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc-10-20200419/gcc/tree.c:9777
0x5eaf44 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc-10-20200419/gcc/tree.h:3410
0x5eaf44 diag_attr_exclusions
        ../../gcc-10-20200419/gcc/attribs.c:396
0x7d4fda diag_attr_exclusions
        ../../gcc-10-20200419/gcc/attribs.c:379
0x7d6fb5 decl_attributes(tree_node**, tree_node*, int, tree_node*)
        ../../gcc-10-20200419/gcc/attribs.c:694
0x7f2554 start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
        ../../gcc-10-20200419/gcc/c/c-decl.c:5117
0x84cdd5 c_parser_declaration_or_fndef
        ../../gcc-10-20200419/gcc/c/c-parser.c:2271
0x8302bf c_parser_compound_statement_nostart
        ../../gcc-10-20200419/gcc/c/c-parser.c:5718
0x84c8c4 c_parser_compound_statement
        ../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
        ../../gcc-10-20200419/gcc/c/c-parser.c:2505
0x8566e3 c_parser_external_declaration
        ../../gcc-10-20200419/gcc/c/c-parser.c:1745
0x8571e1 c_parser_translation_unit
        ../../gcc-10-20200419/gcc/c/c-parser.c:1618
0x8571e1 c_parse_file()
        ../../gcc-10-20200419/gcc/c/c-parser.c:21745
0x8ae2cb c_common_parse_file()
        ../../gcc-10-20200419/gcc/c-family/c-opts.c:1190
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-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 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-9 test.c 
test.c: In function ‘sub_1’:
test.c:4:15: error: ‘sub_2’ undeclared (first use in this function); did you
mean ‘sub_1’?
    4 |  if ( sub_0 ( sub_2 ) )
      |               ^~~~~
      |               sub_1
test.c:4:15: note: each undeclared identifier is reported only once for each
function it appears in
test.c:9: confused by earlier errors, bailing out

Reply via email to