public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146
@ 2022-04-06 18:25 gscfq@t-online.de
2022-04-06 18:36 ` [Bug c++/105186] " mpolacek at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: gscfq@t-online.de @ 2022-04-06 18:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Bug ID: 105186
Summary: ICE in canonicalize_attr_name, at attribs.h:146
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Affects versions down to at least r5 :
$ cat z1.cc
__attribute__((__int128))
$ g++-12-20220403 -c z1.cc
z1.cc:1:16: internal compiler error: Segmentation fault
1 | __attribute__((__int128))
| ^~~~~~~~
0x10d3b0f crash_signal
../../gcc/toplev.cc:322
0x9035f5 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3456
0x9035f5 canonicalize_attr_name
../../gcc/attribs.h:146
0x9035f5 cp_parser_gnu_attribute_list
../../gcc/cp/parser.cc:28737
0x903831 cp_parser_gnu_attributes_opt
../../gcc/cp/parser.cc:28662
0x94439c cp_parser_declaration
../../gcc/cp/parser.cc:14844
0x94512d cp_parser_translation_unit
../../gcc/cp/parser.cc:5010
0x94512d c_parse_file()
../../gcc/cp/parser.cc:48057
0xad39a2 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1240
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
@ 2022-04-06 18:36 ` mpolacek at gcc dot gnu.org
2022-04-07 13:16 ` [Bug c++/105186] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-04-06 18:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-04-06
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed. Somewhat better test:
__attribute__((__int128)) int i;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10/11/12 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
2022-04-06 18:36 ` [Bug c++/105186] " mpolacek at gcc dot gnu.org
@ 2022-04-07 13:16 ` jakub at gcc dot gnu.org
2022-04-07 15:29 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-07 13:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Summary|ICE in |[9/10/11/12 Regression] ICE
|canonicalize_attr_name, at |in canonicalize_attr_name,
|attribs.h:146 |at attribs.h:146
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |9.5
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r5-4106-g78a7c3172fe2e6cd959abb8bfc69f6b0dc747d49
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10/11/12 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
2022-04-06 18:36 ` [Bug c++/105186] " mpolacek at gcc dot gnu.org
2022-04-07 13:16 ` [Bug c++/105186] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
@ 2022-04-07 15:29 ` jakub at gcc dot gnu.org
2022-04-11 8:42 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-07 15:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
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 52769
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52769&action=edit
gcc12-pr105186.patch
Untested fix.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10/11/12 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (2 preceding siblings ...)
2022-04-07 15:29 ` jakub at gcc dot gnu.org
@ 2022-04-11 8:42 ` cvs-commit at gcc dot gnu.org
2022-04-11 9:04 ` [Bug c++/105186] [9/10/11 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-11 8:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
--- 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:083e8e66d2e90992fa83a53bfc3553dfa91abda1
commit r12-8077-g083e8e66d2e90992fa83a53bfc3553dfa91abda1
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Apr 11 10:41:07 2022 +0200
c-family: Initialize ridpointers for __int128 etc. [PR105186]
The following testcase ICEs with C++ and is incorrectly rejected with C.
The reason is that both FEs use ridpointers identifiers for CPP_KEYWORD
and value or u.value for CPP_NAME e.g. when parsing attributes or OpenMP
directives etc., like:
/* Save away the identifier that indicates which attribute
this is. */
identifier = (token->type == CPP_KEYWORD)
/* For keywords, use the canonical spelling, not the
parsed identifier. */
? ridpointers[(int) token->keyword]
: id_token->u.value;
identifier = canonicalize_attr_name (identifier);
I've tried to change those to use ridpointers only if non-NULL and
otherwise
use the value/u.value even for CPP_KEYWORDS, but that was a large 10 hunks
patch.
The following patch instead just initializes ridpointers for the __intNN
keywords. It can't be done earlier before we record_builtin_type as there
are 2 different spellings and if we initialize those ridpointers early, the
second record_builtin_type fails miserably.
2022-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/105186
* c-common.cc (c_common_nodes_and_builtins): After registering
__int%d
and __int%d__ builtin types, initialize corresponding ridpointers
entry.
* c-c++-common/pr105186.c: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10/11 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (3 preceding siblings ...)
2022-04-11 8:42 ` cvs-commit at gcc dot gnu.org
@ 2022-04-11 9:04 ` jakub at gcc dot gnu.org
2022-04-13 4:28 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-11 9:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
|in canonicalize_attr_name, |canonicalize_attr_name, at
|at attribs.h:146 |attribs.h:146
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10/11 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (4 preceding siblings ...)
2022-04-11 9:04 ` [Bug c++/105186] [9/10/11 " jakub at gcc dot gnu.org
@ 2022-04-13 4:28 ` cvs-commit at gcc dot gnu.org
2022-04-13 5:59 ` [Bug c++/105186] [9/10 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-13 4:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:473f2b099bdb3e72591b37f42e566086792f453d
commit r11-9847-g473f2b099bdb3e72591b37f42e566086792f453d
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Apr 11 10:41:07 2022 +0200
c-family: Initialize ridpointers for __int128 etc. [PR105186]
The following testcase ICEs with C++ and is incorrectly rejected with C.
The reason is that both FEs use ridpointers identifiers for CPP_KEYWORD
and value or u.value for CPP_NAME e.g. when parsing attributes or OpenMP
directives etc., like:
/* Save away the identifier that indicates which attribute
this is. */
identifier = (token->type == CPP_KEYWORD)
/* For keywords, use the canonical spelling, not the
parsed identifier. */
? ridpointers[(int) token->keyword]
: id_token->u.value;
identifier = canonicalize_attr_name (identifier);
I've tried to change those to use ridpointers only if non-NULL and
otherwise
use the value/u.value even for CPP_KEYWORDS, but that was a large 10 hunks
patch.
The following patch instead just initializes ridpointers for the __intNN
keywords. It can't be done earlier before we record_builtin_type as there
are 2 different spellings and if we initialize those ridpointers early, the
second record_builtin_type fails miserably.
2022-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/105186
* c-common.c (c_common_nodes_and_builtins): After registering
__int%d
and __int%d__ builtin types, initialize corresponding ridpointers
entry.
* c-c++-common/pr105186.c: New test.
(cherry picked from commit 083e8e66d2e90992fa83a53bfc3553dfa91abda1)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (5 preceding siblings ...)
2022-04-13 4:28 ` cvs-commit at gcc dot gnu.org
@ 2022-04-13 5:59 ` jakub at gcc dot gnu.org
2022-05-10 8:26 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-13 5:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
|canonicalize_attr_name, at |canonicalize_attr_name, at
|attribs.h:146 |attribs.h:146
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed also for 11.3.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (6 preceding siblings ...)
2022-04-13 5:59 ` [Bug c++/105186] [9/10 " jakub at gcc dot gnu.org
@ 2022-05-10 8:26 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:26 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:73f5db083a73c6125e0203ea50c4d1f0a1c6421a
commit r10-10706-g73f5db083a73c6125e0203ea50c4d1f0a1c6421a
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Apr 11 10:41:07 2022 +0200
c-family: Initialize ridpointers for __int128 etc. [PR105186]
The following testcase ICEs with C++ and is incorrectly rejected with C.
The reason is that both FEs use ridpointers identifiers for CPP_KEYWORD
and value or u.value for CPP_NAME e.g. when parsing attributes or OpenMP
directives etc., like:
/* Save away the identifier that indicates which attribute
this is. */
identifier = (token->type == CPP_KEYWORD)
/* For keywords, use the canonical spelling, not the
parsed identifier. */
? ridpointers[(int) token->keyword]
: id_token->u.value;
identifier = canonicalize_attr_name (identifier);
I've tried to change those to use ridpointers only if non-NULL and
otherwise
use the value/u.value even for CPP_KEYWORDS, but that was a large 10 hunks
patch.
The following patch instead just initializes ridpointers for the __intNN
keywords. It can't be done earlier before we record_builtin_type as there
are 2 different spellings and if we initialize those ridpointers early, the
second record_builtin_type fails miserably.
2022-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/105186
* c-common.c (c_common_nodes_and_builtins): After registering
__int%d
and __int%d__ builtin types, initialize corresponding ridpointers
entry.
* c-c++-common/pr105186.c: New test.
(cherry picked from commit 083e8e66d2e90992fa83a53bfc3553dfa91abda1)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (7 preceding siblings ...)
2022-05-10 8:26 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:26 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
--- Comment #9 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:6547662a2afdac90311bcd286f87e98e6bec03d0
commit r9-10147-g6547662a2afdac90311bcd286f87e98e6bec03d0
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Apr 11 10:41:07 2022 +0200
c-family: Initialize ridpointers for __int128 etc. [PR105186]
The following testcase ICEs with C++ and is incorrectly rejected with C.
The reason is that both FEs use ridpointers identifiers for CPP_KEYWORD
and value or u.value for CPP_NAME e.g. when parsing attributes or OpenMP
directives etc., like:
/* Save away the identifier that indicates which attribute
this is. */
identifier = (token->type == CPP_KEYWORD)
/* For keywords, use the canonical spelling, not the
parsed identifier. */
? ridpointers[(int) token->keyword]
: id_token->u.value;
identifier = canonicalize_attr_name (identifier);
I've tried to change those to use ridpointers only if non-NULL and
otherwise
use the value/u.value even for CPP_KEYWORDS, but that was a large 10 hunks
patch.
The following patch instead just initializes ridpointers for the __intNN
keywords. It can't be done earlier before we record_builtin_type as there
are 2 different spellings and if we initialize those ridpointers early, the
second record_builtin_type fails miserably.
2022-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/105186
* c-common.c (c_common_nodes_and_builtins): After registering
__int%d
and __int%d__ builtin types, initialize corresponding ridpointers
entry.
* c-c++-common/pr105186.c: New test.
(cherry picked from commit 083e8e66d2e90992fa83a53bfc3553dfa91abda1)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/105186] [9/10 Regression] ICE in canonicalize_attr_name, at attribs.h:146
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
` (8 preceding siblings ...)
2022-05-11 6:26 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11 6:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105186
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-05-11 6:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 18:25 [Bug c++/105186] New: ICE in canonicalize_attr_name, at attribs.h:146 gscfq@t-online.de
2022-04-06 18:36 ` [Bug c++/105186] " mpolacek at gcc dot gnu.org
2022-04-07 13:16 ` [Bug c++/105186] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
2022-04-07 15:29 ` jakub at gcc dot gnu.org
2022-04-11 8:42 ` cvs-commit at gcc dot gnu.org
2022-04-11 9:04 ` [Bug c++/105186] [9/10/11 " jakub at gcc dot gnu.org
2022-04-13 4:28 ` cvs-commit at gcc dot gnu.org
2022-04-13 5:59 ` [Bug c++/105186] [9/10 " jakub at gcc dot gnu.org
2022-05-10 8:26 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:26 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` 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).