public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
@ 2021-07-01 14:02 anbu1024.me at gmail dot com
2021-07-01 18:56 ` [Bug c/101285] [9/10/11/12 " marxin at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: anbu1024.me at gmail dot com @ 2021-07-01 14:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Bug ID: 101285
Summary: [12 Regression] ICE: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in
c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
Product: gcc
Version: 12.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 5b.c
extern char b[1];
void foo(void (*func)(void *), void * z);
static void bar(void * z)
{
return z;
}
void baz()
{
foo( (void (*)(int (*a)[b++])) bar);
}
--------------------------------
$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210627 (experimental)
Copyright (C) 2021 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-sp12 5b.c
5b.c: In function ‘bar’:
5b.c:8:12: warning: ‘return’ with a value, in function returning void
8 | return z;
| ^
5b.c:6:13: note: declared here
6 | static void bar(void * z)
| ^~~
5b.c: In function ‘baz’:
5b.c:13:30: error: lvalue required as increment operand
13 | foo( (void (*)(int (*a)[b++])) bar);
| ^~
5b.c:13:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
13 | foo( (void (*)(int (*a)[b++])) bar);
| ^~~
0x7a7886 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc-12-20210627/gcc/tree.c:8734
0x663d43 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc-12-20210627/gcc/tree.h:3496
0x663d43 c_safe_arg_type_equiv_p
../../gcc-12-20210627/gcc/c/c-typeck.c:5830
0x8a8c75 c_safe_function_type_cast_p
../../gcc-12-20210627/gcc/c/c-typeck.c:5872
0x8a8c75 build_c_cast(unsigned int, tree_node*, tree_node*)
../../gcc-12-20210627/gcc/c/c-typeck.c:6079
0x8a9a34 c_cast_expr(unsigned int, c_type_name*, tree_node*)
../../gcc-12-20210627/gcc/c/c-typeck.c:6160
0x8cba45 c_parser_cast_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8058
0x8cbbac c_parser_binary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7869
0x8cce65 c_parser_conditional_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7592
0x8cd4a0 c_parser_expr_no_commas
../../gcc-12-20210627/gcc/c/c-parser.c:7507
0x8bf207 c_parser_expr_list
../../gcc-12-20210627/gcc/c/c-parser.c:10746
0x8ce66c c_parser_postfix_expression_after_primary
../../gcc-12-20210627/gcc/c/c-parser.c:10475
0x8c5d63 c_parser_postfix_expression
../../gcc-12-20210627/gcc/c/c-parser.c:10178
0x8ca16a c_parser_unary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8224
0x8cb939 c_parser_cast_expression
../../gcc-12-20210627/gcc/c/c-parser.c:8066
0x8cbbac c_parser_binary_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7869
0x8cce65 c_parser_conditional_expression
../../gcc-12-20210627/gcc/c/c-parser.c:7592
0x8cd4a0 c_parser_expr_no_commas
../../gcc-12-20210627/gcc/c/c-parser.c:7507
0x8cd721 c_parser_expression
../../gcc-12-20210627/gcc/c/c-parser.c:10641
0x8cde98 c_parser_expression_conv
../../gcc-12-20210627/gcc/c/c-parser.c:10680
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-sp11 --version
gcc (GCC) 11.1.1 20210619
Copyright (C) 2021 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-sp11 5b.c
5b.c: In function ‘bar’:
5b.c:8:12: warning: ‘return’ with a value, in function returning void
8 | return z;
| ^
5b.c:6:13: note: declared here
6 | static void bar(void * z)
| ^~~
5b.c: In function ‘baz’:
5b.c:13:30: error: lvalue required as increment operand
13 | foo( (void (*)(int (*a)[b++])) bar);
| ^~
5b.c:13:5: error: too few arguments to function ‘foo’
13 | foo( (void (*)(int (*a)[b++])) bar);
| ^~~
5b.c:4:6: note: declared here
4 | void foo(void (*func)(void *), void * z);
| ^~~
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [9/10/11/12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
@ 2021-07-01 18:56 ` marxin at gcc dot gnu.org
2021-07-02 6:16 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-07-01 18:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[12 Regression] ICE: tree |[9/10/11/12 Regression]
|check: expected class |ICE: tree check: expected
|‘type’, have ‘exceptional’ |class ‘type’, have
|(error_mark) in |‘exceptional’ (error_mark)
|c_safe_arg_type_equiv_p, at |in c_safe_arg_type_equiv_p,
|c/c-typeck.c:5830 |at c/c-typeck.c:5830
CC| |edlinger at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r8-5312-gc65e18d3331aa999.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [9/10/11/12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
2021-07-01 18:56 ` [Bug c/101285] [9/10/11/12 " marxin at gcc dot gnu.org
@ 2021-07-02 6:16 ` rguenth at gcc dot gnu.org
2022-05-27 9:45 ` [Bug c/101285] [10/11/12/13 " rguenth at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-02 6:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
Keywords| |error-recovery,
| |ice-on-invalid-code
Priority|P3 |P4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [10/11/12/13 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
2021-07-01 18:56 ` [Bug c/101285] [9/10/11/12 " marxin at gcc dot gnu.org
2021-07-02 6:16 ` rguenth at gcc dot gnu.org
@ 2022-05-27 9:45 ` rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [10/11/12/13 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (2 preceding siblings ...)
2022-05-27 9:45 ` [Bug c/101285] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:45 ` jakub at gcc dot gnu.org
2022-11-15 19:41 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [10/11/12/13 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (3 preceding siblings ...)
2022-06-28 10:45 ` jakub at gcc dot gnu.org
@ 2022-11-15 19:41 ` pinskia at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c/101285] [11/12/13/14 " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-15 19:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org
Last reconfirmed| |2022-11-15
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
Keywords| |ice-checking
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (4 preceding siblings ...)
2022-11-15 19:41 ` pinskia at gcc dot gnu.org
@ 2023-07-07 10:40 ` rguenth at gcc dot gnu.org
2023-10-14 20:28 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (5 preceding siblings ...)
2023-07-07 10:40 ` [Bug c/101285] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2023-10-14 20:28 ` pinskia at gcc dot gnu.org
2023-10-15 1:18 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-14 20:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 56108
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56108&action=edit
Patch which I am testing
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (6 preceding siblings ...)
2023-10-14 20:28 ` pinskia at gcc dot gnu.org
@ 2023-10-15 1:18 ` pinskia at gcc dot gnu.org
2023-10-18 22:35 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-15 1:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
URL| |https://gcc.gnu.org/piperma
| |il/gcc-patches/2023-October
| |/633013.html
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633013.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (7 preceding siblings ...)
2023-10-15 1:18 ` pinskia at gcc dot gnu.org
@ 2023-10-18 22:35 ` cvs-commit at gcc dot gnu.org
2023-10-18 22:35 ` pinskia at gcc dot gnu.org
2023-10-18 22:35 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-18 22:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:11e6bcedb41359c69ee790f38b04033d236336a8
commit r14-4727-g11e6bcedb41359c69ee790f38b04033d236336a8
Author: Andrew Pinski <pinskia@gmail.com>
Date: Sat Oct 14 13:18:00 2023 -0700
Fix ICE due to c_safe_arg_type_equiv_p not checking for error_mark node
This is a simple error recovery issue when c_safe_arg_type_equiv_p
was added in r8-5312-gc65e18d3331aa999. The issue is that after
an error, an argument type (of a function type) might turn
into an error mark node and c_safe_arg_type_equiv_p was not ready
for that. So this just adds a check for error operand for its
arguments before getting the main variant.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR c/101285
gcc/c/ChangeLog:
* c-typeck.cc (c_safe_arg_type_equiv_p): Return true for error
operands early.
gcc/testsuite/ChangeLog:
* gcc.dg/pr101285-1.c: New test.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (8 preceding siblings ...)
2023-10-18 22:35 ` cvs-commit at gcc dot gnu.org
@ 2023-10-18 22:35 ` pinskia at gcc dot gnu.org
2023-10-18 22:35 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-18 22:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |14.0
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed on the trunk, this is an error recovery issue so not backporting.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101285] [11/12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
` (9 preceding siblings ...)
2023-10-18 22:35 ` pinskia at gcc dot gnu.org
@ 2023-10-18 22:35 ` pinskia at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-18 22:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101285
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-10-18 22:35 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 14:02 [Bug c/101285] New: [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in c_safe_arg_type_equiv_p, at c/c-typeck.c:5830 anbu1024.me at gmail dot com
2021-07-01 18:56 ` [Bug c/101285] [9/10/11/12 " marxin at gcc dot gnu.org
2021-07-02 6:16 ` rguenth at gcc dot gnu.org
2022-05-27 9:45 ` [Bug c/101285] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2022-11-15 19:41 ` pinskia at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c/101285] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-10-14 20:28 ` pinskia at gcc dot gnu.org
2023-10-15 1:18 ` pinskia at gcc dot gnu.org
2023-10-18 22:35 ` cvs-commit at gcc dot gnu.org
2023-10-18 22:35 ` pinskia at gcc dot gnu.org
2023-10-18 22:35 ` pinskia 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).