* [Bug c++/95560] internal compiler error: Segmentation fault
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
@ 2020-06-06 10:10 ` rebel at ameritech dot net
2020-06-06 10:12 ` rebel at ameritech dot net
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rebel at ameritech dot net @ 2020-06-06 10:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #1 from RJE <rebel at ameritech dot net> ---
Created attachment 48691
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48691&action=edit
Compile information .ii file compressed
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] internal compiler error: Segmentation fault
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
2020-06-06 10:10 ` [Bug c++/95560] " rebel at ameritech dot net
@ 2020-06-06 10:12 ` rebel at ameritech dot net
2020-06-09 12:00 ` [Bug c++/95560] [10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r10-4254-ge0d91792eec490d1 marxin at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rebel at ameritech dot net @ 2020-06-06 10:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #2 from RJE <rebel at ameritech dot net> ---
Created attachment 48692
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48692&action=edit
assembler source
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r10-4254-ge0d91792eec490d1
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
2020-06-06 10:10 ` [Bug c++/95560] " rebel at ameritech dot net
2020-06-06 10:12 ` rebel at ameritech dot net
@ 2020-06-09 12:00 ` marxin at gcc dot gnu.org
2020-06-09 12:36 ` edlinger at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-09 12:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Host|x86_64-w64-mingw32 |
Ever confirmed|0 |1
CC| |edlinger at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Last reconfirmed| |2020-06-09
Build|x86_64-w64-mingw32 |
Summary|internal compiler error: |[10/11 Regression] ICE in
|Segmentation fault |comptypes, at
| |cp/typeck.c:1498 since
| |r10-4254-ge0d91792eec490d1
Status|UNCONFIRMED |NEW
Target|x86_64-w64-mingw32 |
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r10-4254-ge0d91792eec490d1.
Reduced test-case:
$ cat pr95560.ii
template <typename> void fn1() {
bool ready;
enum class State { ready };
}
$ g++ -c -std=c++2a pr95560.ii
pr95560.ii: In function ‘void fn1()’:
pr95560.ii:3:22: internal compiler error: in comptypes, at cp/typeck.c:1498
3 | enum class State { ready };
| ^~~~~
0x6be442 comptypes(tree_node*, tree_node*, int)
/home/marxin/Programming/gcc/gcc/cp/typeck.c:1498
0x9ab7ea check_local_shadow
/home/marxin/Programming/gcc/gcc/cp/name-lookup.c:2765
0x9ab7ea do_pushdecl
/home/marxin/Programming/gcc/gcc/cp/name-lookup.c:3112
0x9ac140 pushdecl(tree_node*, bool)
/home/marxin/Programming/gcc/gcc/cp/name-lookup.c:3177
0x93c722 build_enumerator(tree_node*, tree_node*, tree_node*, tree_node*,
unsigned int)
/home/marxin/Programming/gcc/gcc/cp/decl.c:15922
0x9cd7a7 cp_parser_enumerator_definition
/home/marxin/Programming/gcc/gcc/cp/parser.c:19544
0x9cd7a7 cp_parser_enumerator_list
/home/marxin/Programming/gcc/gcc/cp/parser.c:19473
0x9cd7a7 cp_parser_enum_specifier
/home/marxin/Programming/gcc/gcc/cp/parser.c:19404
0x9cd7a7 cp_parser_type_specifier
/home/marxin/Programming/gcc/gcc/cp/parser.c:17734
0x9cdd62 cp_parser_decl_specifier_seq
/home/marxin/Programming/gcc/gcc/cp/parser.c:14410
0x9ce941 cp_parser_simple_declaration
/home/marxin/Programming/gcc/gcc/cp/parser.c:13664
0x9d07ea cp_parser_declaration_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:13217
0x9d146a cp_parser_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:11523
0x9d2398 cp_parser_statement_seq_opt
/home/marxin/Programming/gcc/gcc/cp/parser.c:11889
0x9d2478 cp_parser_compound_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:11839
0x9e9a65 cp_parser_function_body
/home/marxin/Programming/gcc/gcc/cp/parser.c:23110
0x9e9a65 cp_parser_ctor_initializer_opt_and_function_body
/home/marxin/Programming/gcc/gcc/cp/parser.c:23161
0x9ecd9d cp_parser_function_definition_after_declarator
/home/marxin/Programming/gcc/gcc/cp/parser.c:29057
0x9edd89 cp_parser_function_definition_from_specifiers_and_declarator
/home/marxin/Programming/gcc/gcc/cp/parser.c:28973
0x9edd89 cp_parser_init_declarator
/home/marxin/Programming/gcc/gcc/cp/parser.c:20721
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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r10-4254-ge0d91792eec490d1
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (2 preceding siblings ...)
2020-06-09 12:00 ` [Bug c++/95560] [10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r10-4254-ge0d91792eec490d1 marxin at gcc dot gnu.org
@ 2020-06-09 12:36 ` edlinger at gcc dot gnu.org
2020-06-09 12:50 ` [Bug c++/95560] [8/9/10/11 " marxin at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: edlinger at gcc dot gnu.org @ 2020-06-09 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #4 from Bernd Edlinger <edlinger at gcc dot gnu.org> ---
don't know if it helps, but with -Wshadow=compatible-local
the regression begins probably earlier.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r10-4254-ge0d91792eec490d1
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (3 preceding siblings ...)
2020-06-09 12:36 ` edlinger at gcc dot gnu.org
@ 2020-06-09 12:50 ` marxin at gcc dot gnu.org
2020-06-10 18:50 ` [Bug c++/95560] [8/9/10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-09 12:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] ICE in |[8/9/10/11 Regression] ICE
|comptypes, at |in comptypes, at
|cp/typeck.c:1498 since |cp/typeck.c:1498 since
|r10-4254-ge0d91792eec490d1 |r10-4254-ge0d91792eec490d1
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
You are right, with:
g++ pr95560.ii -std=c++17 -c -Wshadow=compatible-local
it started with r7-4206-g84ff4775d41b716c.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (4 preceding siblings ...)
2020-06-09 12:50 ` [Bug c++/95560] [8/9/10/11 " marxin at gcc dot gnu.org
@ 2020-06-10 18:50 ` mpolacek at gcc dot gnu.org
2020-06-11 20:36 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-10 18:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We have a CONST_DECL with null type -- it's the case when the underlying type
is not fixed, and finish_enum_value_list hasn't yet run. A stopgap fix would
be
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2762,7 +2762,9 @@ check_local_shadow (tree decl)
enum opt_code warning_code;
if (warn_shadow)
warning_code = OPT_Wshadow;
- else if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))
+ else if ((TREE_TYPE (old)
+ && TREE_TYPE (decl)
+ && same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
|| TREE_CODE (decl) == TYPE_DECL
|| TREE_CODE (old) == TYPE_DECL
|| (!dependent_type_p (TREE_TYPE (decl))
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (5 preceding siblings ...)
2020-06-10 18:50 ` [Bug c++/95560] [8/9/10/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c mpolacek at gcc dot gnu.org
@ 2020-06-11 20:36 ` cvs-commit at gcc dot gnu.org
2020-06-11 20:40 ` [Bug c++/95560] [8/9/11 " mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 20:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:23dd42562369911a92d7da045ebe2c03b286a769
commit r10-8281-g23dd42562369911a92d7da045ebe2c03b286a769
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Jun 11 16:35:33 2020 -0400
c++: Fix ICE in check_local_shadow with enum [PR95560]
Another indication that perhaps this warning is emitted too early. We
crash because same_type_p gets a null type: we have an enumerator
without a fixed underlying type and finish_enum_value_list hasn't yet
run. So check if the type is null before calling same_type_p.
PR c++/95560
* name-lookup.c (check_local_shadow): Check if types are
non-null before calling same_type_p.
* g++.dg/warn/Wshadow-local-3.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (6 preceding siblings ...)
2020-06-11 20:36 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 20:40 ` mpolacek at gcc dot gnu.org
2020-06-11 22:36 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-11 20:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |8.5
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (7 preceding siblings ...)
2020-06-11 20:40 ` [Bug c++/95560] [8/9/11 " mpolacek at gcc dot gnu.org
@ 2020-06-11 22:36 ` cvs-commit at gcc dot gnu.org
2020-06-11 22:37 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 22:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:02f6c5b711b8188c3f49a79c730911b0bd216585
commit r9-8668-g02f6c5b711b8188c3f49a79c730911b0bd216585
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Jun 11 17:58:21 2020 -0400
c++: Fix ICE in check_local_shadow with enum [PR95560]
Another indication that perhaps this warning is emitted too early. We
crash because same_type_p gets a null type: we have an enumerator
without a fixed underlying type and finish_enum_value_list hasn't yet
run. So check if the type is null before calling same_type_p.
PR c++/95560
* name-lookup.c (check_local_shadow): Check if types are
non-null before calling same_type_p.
* g++.dg/warn/Wshadow-compatible-local-3.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/9/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (8 preceding siblings ...)
2020-06-11 22:36 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 22:37 ` mpolacek at gcc dot gnu.org
2020-06-11 22:37 ` [Bug c++/95560] [8/11 " mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-11 22:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (9 preceding siblings ...)
2020-06-11 22:37 ` mpolacek at gcc dot gnu.org
@ 2020-06-11 22:37 ` mpolacek at gcc dot gnu.org
2020-06-16 17:09 ` cvs-commit at gcc dot gnu.org
2020-06-16 17:12 ` mpolacek at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-11 22:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |ASSIGNED
Summary|[8/9/11 Regression] ICE in |[8/11 Regression] ICE in
|comptypes, at |comptypes, at
|cp/typeck.c:1498 since |cp/typeck.c:1498 since
|r7-4206-g84ff4775d41b716c |r7-4206-g84ff4775d41b716c
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Actually not on trunk yet.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (10 preceding siblings ...)
2020-06-11 22:37 ` [Bug c++/95560] [8/11 " mpolacek at gcc dot gnu.org
@ 2020-06-16 17:09 ` cvs-commit at gcc dot gnu.org
2020-06-16 17:12 ` mpolacek at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-16 17:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:2661635323bd44410f1a154683eccecd2c163b46
commit r11-1391-g2661635323bd44410f1a154683eccecd2c163b46
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Jun 16 13:02:23 2020 -0400
c++: Fix ICE in check_local_shadow with enum [PR95560]
Another indication that perhaps this warning is emitted too early. We
crash because same_type_p gets a null type: we have an enumerator
without a fixed underlying type and finish_enum_value_list hasn't yet
run. So check if the type is null before calling same_type_p.
PR c++/95560
* name-lookup.c (check_local_shadow): Check if types are
non-null before calling same_type_p.
* g++.dg/warn/Wshadow-local-3.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/95560] [8/11 Regression] ICE in comptypes, at cp/typeck.c:1498 since r7-4206-g84ff4775d41b716c
2020-06-06 10:02 [Bug c++/95560] New: internal compiler error: Segmentation fault rebel at ameritech dot net
` (11 preceding siblings ...)
2020-06-16 17:09 ` cvs-commit at gcc dot gnu.org
@ 2020-06-16 17:12 ` mpolacek at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-16 17:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95560
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #12 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread