public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
@ 2020-11-09 8:00 asolokha at gmx dot com
2020-11-09 8:18 ` [Bug c++/97762] " rguenth at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2020-11-09 8:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Bug ID: 97762
Summary: [11 Regression] ICE: Segmentation fault (in
warn_about_ambiguous_parse)
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
g++-11.0.0-alpha20201108 snapshot (g:b642fca1c31b2e2175e0860daf32b4ee0d918085)
ICEs when compiling gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c:
% g++-11.0.0 -c gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c
gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c: In function 'int main()':
gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c:12:32: internal compiler
error: Segmentation fault
12 | long nested_0 (long a, long b)
| ^
0x10302ff crash_signal
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/toplev.c:330
0x9bf80b warn_about_ambiguous_parse
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:20656
0x9f6199 cp_parser_init_declarator
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:20943
0x9d56de cp_parser_simple_declaration
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:13892
0x9d768c cp_parser_declaration_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:13332
0x9d835f cp_parser_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:11578
0x9d943d cp_parser_statement_seq_opt
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:11944
0x9d9518 cp_parser_compound_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:11894
0x9f2524 cp_parser_function_body
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:23410
0x9f2524 cp_parser_ctor_initializer_opt_and_function_body
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:23461
0x9f5dc9 cp_parser_function_definition_after_declarator
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:29355
0x9f6e19 cp_parser_function_definition_from_specifiers_and_declarator
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:29271
0x9f6e19 cp_parser_init_declarator
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:20983
0x9d56de cp_parser_simple_declaration
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:13892
0xa02266 cp_parser_declaration
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:13591
0xa028d0 cp_parser_translation_unit
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:4796
0xa028d0 c_parse_file()
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/cp/parser.c:44444
0xb2621d c_common_parse_file()
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201108/work/gcc-11-20201108/gcc/c-family/c-opts.c:1196
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
@ 2020-11-09 8:18 ` rguenth at gcc dot gnu.org
2020-11-09 8:53 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-09 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
2020-11-09 8:18 ` [Bug c++/97762] " rguenth at gcc dot gnu.org
@ 2020-11-09 8:53 ` marxin at gcc dot gnu.org
2020-11-09 13:57 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-09 8:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |marxin at gcc dot gnu.org,
| |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-11-09
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-4756-g5b2003105b35f8fe.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
2020-11-09 8:18 ` [Bug c++/97762] " rguenth at gcc dot gnu.org
2020-11-09 8:53 ` marxin at gcc dot gnu.org
@ 2020-11-09 13:57 ` mpolacek at gcc dot gnu.org
2020-11-09 14:57 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-09 13:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
` (2 preceding siblings ...)
2020-11-09 13:57 ` mpolacek at gcc dot gnu.org
@ 2020-11-09 14:57 ` mpolacek at gcc dot gnu.org
2020-11-09 19:40 ` cvs-commit at gcc dot gnu.org
2020-11-09 19:41 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-09 14:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|ice-on-invalid-code |ice-on-valid-code
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The code is valid.
// PR c++/97762
// { dg-do compile }
void
g ()
{
long a(); // { dg-warning "empty parentheses" }
signed b(); // { dg-warning "empty parentheses" }
unsigned c(); // { dg-warning "empty parentheses" }
short d(); // { dg-warning "empty parentheses" }
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
` (3 preceding siblings ...)
2020-11-09 14:57 ` mpolacek at gcc dot gnu.org
@ 2020-11-09 19:40 ` cvs-commit at gcc dot gnu.org
2020-11-09 19:41 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-09 19:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
--- Comment #4 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:3a5f8d745f8e26d973218b088788f22ad197ca67
commit r11-4850-g3a5f8d745f8e26d973218b088788f22ad197ca67
Author: Marek Polacek <polacek@redhat.com>
Date: Mon Nov 9 10:19:07 2020 -0500
c++: Fix -Wvexing-parse ICE with omitted int [PR97762]
For declarations like
long f();
decl_specifiers->type will be NULL, but I neglected to handle this case,
therefore we ICE. So handle this case by pretending we've seen 'int',
which is good enough for -Wvexing-parse's purposes.
gcc/cp/ChangeLog:
PR c++/97762
* parser.c (warn_about_ambiguous_parse): Handle the case when
there is no type in the decl-specifiers.
gcc/testsuite/ChangeLog:
PR c++/97762
* g++.dg/warn/Wvexing-parse8.C: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97762] [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse)
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
` (4 preceding siblings ...)
2020-11-09 19:40 ` cvs-commit at gcc dot gnu.org
@ 2020-11-09 19:41 ` mpolacek at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-09 19:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97762
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-09 19:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 8:00 [Bug c++/97762] New: [11 Regression] ICE: Segmentation fault (in warn_about_ambiguous_parse) asolokha at gmx dot com
2020-11-09 8:18 ` [Bug c++/97762] " rguenth at gcc dot gnu.org
2020-11-09 8:53 ` marxin at gcc dot gnu.org
2020-11-09 13:57 ` mpolacek at gcc dot gnu.org
2020-11-09 14:57 ` mpolacek at gcc dot gnu.org
2020-11-09 19:40 ` cvs-commit at gcc dot gnu.org
2020-11-09 19:41 ` 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).