public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396
@ 2020-04-22 7:06 anbu1024.me at gmail dot com
2020-04-22 7:27 ` [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161 jakub at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: anbu1024.me at gmail dot com @ 2020-04-22 7:06 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
@ 2020-04-22 7:27 ` jakub at gcc dot gnu.org
2020-04-22 7:30 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-22 7:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10 Regression] internal |[8/9/10 Regression]
|compiler error: tree check: |internal compiler error:
|expected class ‘type’, have |tree check: expected class
|‘exceptional’ (error_mark) |‘type’, have ‘exceptional’
|in diag_attr_exclusions, at |(error_mark) in
|attribs.c:396 |diag_attr_exclusions, at
| |attribs.c:396 since r8-5161
Keywords| |error-recovery
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Target Milestone|--- |8.5
Last reconfirmed| |2020-04-22
CC| |jakub at gcc dot gnu.org
Priority|P3 |P4
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r8-5161-g5d9ae53d70c72991e26648d915e7fb8e00b8e811
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
2020-04-22 7:27 ` [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161 jakub at gcc dot gnu.org
@ 2020-04-22 7:30 ` jakub at gcc dot gnu.org
2020-04-22 8:21 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-22 7:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly reduced:
void foo ();
int
bar (void)
{
foo (baz);
void __attribute__ ((noinline)) baz (void);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
2020-04-22 7:27 ` [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161 jakub at gcc dot gnu.org
2020-04-22 7:30 ` jakub at gcc dot gnu.org
@ 2020-04-22 8:21 ` jakub at gcc dot gnu.org
2020-04-23 7:55 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-22 8:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48334
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48334&action=edit
gcc10-pr94705.patch
Untested fix.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
` (2 preceding siblings ...)
2020-04-22 8:21 ` jakub at gcc dot gnu.org
@ 2020-04-23 7:55 ` cvs-commit at gcc dot gnu.org
2020-04-23 8:13 ` [Bug c/94705] [8/9 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-23 7:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:e2a71816b4949225498bec37e947293aa7f5841b
commit r10-7906-ge2a71816b4949225498bec37e947293aa7f5841b
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Apr 23 09:54:14 2020 +0200
attribs: Don't diagnose attribute exclusions during error recovery
[PR94705]
On the following testcase GCC ICEs, because last_decl is error_mark_node,
and diag_attr_exclusions assumes that if it is not NULL, it must be a decl.
The following patch just doesn't diagnose attribute exclusions if the
other decl is erroneous (and thus we've already reported errors for it).
2020-04-23 Jakub Jelinek <jakub@redhat.com>
PR c/94705
* attribs.c (decl_attribute): Don't diagnose attribute exclusions
if last_decl is error_mark_node or has such a TREE_TYPE.
* gcc.dg/pr94705.c: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
` (3 preceding siblings ...)
2020-04-23 7:55 ` cvs-commit at gcc dot gnu.org
@ 2020-04-23 8:13 ` jakub at gcc dot gnu.org
2020-09-16 19:20 ` cvs-commit at gcc dot gnu.org
2020-09-17 17:35 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-23 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10 Regression] |[8/9 Regression] internal
|internal compiler error: |compiler error: tree check:
|tree check: expected class |expected class ‘type’, have
|‘type’, have ‘exceptional’ |‘exceptional’ (error_mark)
|(error_mark) in |in diag_attr_exclusions, at
|diag_attr_exclusions, at |attribs.c:396 since r8-5161
|attribs.c:396 since r8-5161 |
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.1+ for now.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
` (4 preceding siblings ...)
2020-04-23 8:13 ` [Bug c/94705] [8/9 " jakub at gcc dot gnu.org
@ 2020-09-16 19:20 ` cvs-commit at gcc dot gnu.org
2020-09-17 17:35 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:934ede34973909eb15b678f88395d83be01433e7
commit r9-8883-g934ede34973909eb15b678f88395d83be01433e7
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Apr 23 09:54:14 2020 +0200
attribs: Don't diagnose attribute exclusions during error recovery
[PR94705]
On the following testcase GCC ICEs, because last_decl is error_mark_node,
and diag_attr_exclusions assumes that if it is not NULL, it must be a decl.
The following patch just doesn't diagnose attribute exclusions if the
other decl is erroneous (and thus we've already reported errors for it).
2020-04-23 Jakub Jelinek <jakub@redhat.com>
PR c/94705
* attribs.c (decl_attribute): Don't diagnose attribute exclusions
if last_decl is error_mark_node or has such a TREE_TYPE.
* gcc.dg/pr94705.c: New test.
(cherry picked from commit e2a71816b4949225498bec37e947293aa7f5841b)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/94705] [8/9 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
` (5 preceding siblings ...)
2020-09-16 19:20 ` cvs-commit at gcc dot gnu.org
@ 2020-09-17 17:35 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-17 17:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94705
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 8.5 in r8-10490-g1dd77eeccc2941323607e88a6fe37625a2dc6698 and by the
above commit for 9.4+ too.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-09-17 17:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 7:06 [Bug c/94705] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 anbu1024.me at gmail dot com
2020-04-22 7:27 ` [Bug c/94705] [8/9/10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in diag_attr_exclusions, at attribs.c:396 since r8-5161 jakub at gcc dot gnu.org
2020-04-22 7:30 ` jakub at gcc dot gnu.org
2020-04-22 8:21 ` jakub at gcc dot gnu.org
2020-04-23 7:55 ` cvs-commit at gcc dot gnu.org
2020-04-23 8:13 ` [Bug c/94705] [8/9 " jakub at gcc dot gnu.org
2020-09-16 19:20 ` cvs-commit at gcc dot gnu.org
2020-09-17 17:35 ` jakub at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).