public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606
@ 2022-09-13 19:37 gscfq@t-online.de
2022-09-13 20:13 ` [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074 marxin at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2022-09-13 19:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
Bug ID: 106937
Summary: [10/11/12/13 Regression] ICE tree check: expected
identifier_node, have tree_list in pp_tree_identifier,
at tree-pretty-print.cc:4606
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Started with r10 around 20190623, file reduced from
llvm-project-llvmorg-14.0.6/clang/test/Sema/attr-nocf_check.cpp :
(gcc configured with --enable-checking=yes)
$ cat z1.cc
[[gnu::nocf_check]] typedef void (*FuncPointerWithNoCfCheck)(void);
typedef void (*FuncPointer)(void);
[[gnu::nocf_check]] void testNoCfCheck();
void testNoCfCheck(){};
int [[gnu::nocf_check]] i;
void testNoCfCheckImpl(double i [[gnu::nocf_check]]) {}
void testNoCfCheckMismatch(FuncPointer f) {
FuncPointerWithNoCfCheck fNoCfCheck = f;
(*fNoCfCheck)();
}
$ g++-13-20220911 -c z1.cc -fcf-protection
z1.cc:5:5: warning: attribute ignored [-Wattributes]
5 | int [[gnu::nocf_check]] i;
| ^
z1.cc:5:5: note: an attribute that appertains to a type-specifier is ignored
z1.cc:6:51: warning: 'nocf_check' attribute only applies to function types
[-Wattributes]
6 | void testNoCfCheckImpl(double i [[gnu::nocf_check]]) {}
| ^
In function 'void testNoCfCheckMismatch(FuncPointer)':
tree check: expected identifier_node, have tree_list in pp_tree_identifier, at
tree-pretty-print.cc:4606
8 | FuncPointerWithNoCfCheck fNoCfCheck = f;
| ^
0x6fc2fc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.cc:8827
0x12b5d03 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3520
0x12b5d03 pp_tree_identifier(pretty_printer*, tree_node*)
../../gcc/tree-pretty-print.cc:4606
0xbcd38a pp_c_attributes_display(c_pretty_printer*, tree_node*)
../../gcc/c-family/c-pretty-print.cc:909
0x91332e dump_type_prefix
../../gcc/cp/error.cc:904
0x913c83 dump_type
../../gcc/cp/error.cc:664
0x91ff6f type_to_string
../../gcc/cp/error.cc:3411
0x923847 cxx_format_postprocessor::handle(pretty_printer*)
../../gcc/cp/error.cc:4348
0x21da278 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1496
0x21b9f10 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1548
0x21ba65a diagnostic_impl
../../gcc/diagnostic.cc:1712
0x21bcdea permerror(rich_location*, char const*, ...)
../../gcc/diagnostic.cc:1994
0x80f736 convert_like_internal
../../gcc/cp/call.cc:7950
0x80ac97 convert_like
../../gcc/cp/call.cc:8501
0x80ac97 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
../../gcc/cp/call.cc:12791
0xb40d82 convert_for_assignment
../../gcc/cp/typeck.cc:10050
0xb414b2 convert_for_initialization(tree_node*, tree_node*, tree_node*, int,
impl_conv_rhs, tree_node*, int, int)
../../gcc/cp/typeck.cc:10141
0xb4bf1a digest_init_r
../../gcc/cp/typeck2.cc:1358
0xb4f100 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/cp/typeck2.cc:1371
0xb4f100 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/cp/typeck2.cc:842
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
@ 2022-09-13 20:13 ` marxin at gcc dot gnu.org
2022-09-14 7:04 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-13 20:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-09-13
Ever confirmed|0 |1
Summary|[10/11/12/13 Regression] |[10/11/12/13 Regression]
|ICE tree check: expected |ICE tree check: expected
|identifier_node, have |identifier_node, have
|tree_list in |tree_list in
|pp_tree_identifier, at |pp_tree_identifier, at
|tree-pretty-print.cc:4606 |tree-pretty-print.cc:4606
| |since
| |r10-1214-g1bf32c1141e23074
Status|UNCONFIRMED |NEW
CC| |marxin at gcc dot gnu.org,
| |mpolacek at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Likely started with r10-1214-g1bf32c1141e23074.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
2022-09-13 20:13 ` [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074 marxin at gcc dot gnu.org
@ 2022-09-14 7:04 ` rguenth at gcc dot gnu.org
2022-09-15 15:41 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-14 7:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
2022-09-13 20:13 ` [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074 marxin at gcc dot gnu.org
2022-09-14 7:04 ` rguenth at gcc dot gnu.org
@ 2022-09-15 15:41 ` mpolacek at gcc dot gnu.org
2022-10-10 19:35 ` cvs-commit at gcc dot gnu.org
2022-10-10 19:41 ` [Bug c++/106937] [10/11/12 " mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-09-15 15:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine then.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
` (2 preceding siblings ...)
2022-09-15 15:41 ` mpolacek at gcc dot gnu.org
@ 2022-10-10 19:35 ` cvs-commit at gcc dot gnu.org
2022-10-10 19:41 ` [Bug c++/106937] [10/11/12 " mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-10 19:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:67efffec943656a509e036cd3c785a5c3d6885e1
commit r13-3202-g67efffec943656a509e036cd3c785a5c3d6885e1
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Sep 29 17:49:32 2022 -0400
c-family: ICE with [[gnu::nocf_check]] [PR106937]
When getting the name of an attribute, we ought to use
get_attribute_name, which handles both [[]] and __attribute__(())
forms. Failure to do so may result in an ICE, like here.
pp_c_attributes_display wasn't able to print the [[]] form of
attributes, so this patch teaches it to.
When printing a pointer to function with a standard attribute, the
attribute
should be printed after the parameter-list. With this patch we print:
aka 'void (*)(int) [[gnu::nocf_check]]'
or, in C++ with noexcept:
aka 'void (*)(int) noexcept [[gnu::nocf_check]]'
pp_c_attributes has been unused since its introduction in r56273 so
this patch removes it.
PR c++/106937
gcc/c-family/ChangeLog:
* c-pretty-print.cc (pp_c_specifier_qualifier_list): Print only GNU
attributes here.
(c_pretty_printer::direct_abstract_declarator): Print the standard
[[]]
attributes here.
(pp_c_attributes): Remove.
(pp_c_attributes_display): Print the [[]] form if appropriate. Use
get_attribute_name. Don't print a trailing space when printing the
[[]] form.
* c-pretty-print.h (pp_c_attributes): Remove.
gcc/cp/ChangeLog:
* error.cc: Include "attribs.h".
(dump_type_prefix): Print only GNU attributes here.
(dump_type_suffix): Print standard attributes here.
gcc/testsuite/ChangeLog:
* c-c++-common/pointer-to-fn1.c: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106937] [10/11/12 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
` (3 preceding siblings ...)
2022-10-10 19:35 ` cvs-commit at gcc dot gnu.org
@ 2022-10-10 19:41 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-10-10 19:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12/13 Regression] |[10/11/12 Regression] ICE
|ICE tree check: expected |tree check: expected
|identifier_node, have |identifier_node, have
|tree_list in |tree_list in
|pp_tree_identifier, at |pp_tree_identifier, at
|tree-pretty-print.cc:4606 |tree-pretty-print.cc:4606
|since |since
|r10-1214-g1bf32c1141e23074 |r10-1214-g1bf32c1141e23074
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed for GCC 13.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-10-10 19:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 19:37 [Bug c++/106937] New: [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 gscfq@t-online.de
2022-09-13 20:13 ` [Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074 marxin at gcc dot gnu.org
2022-09-14 7:04 ` rguenth at gcc dot gnu.org
2022-09-15 15:41 ` mpolacek at gcc dot gnu.org
2022-10-10 19:35 ` cvs-commit at gcc dot gnu.org
2022-10-10 19:41 ` [Bug c++/106937] [10/11/12 " mpolacek 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).