public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
@ 2020-11-17 18:12 asolokha at gmx dot com
  2020-11-17 18:19 ` [Bug c++/97881] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2020-11-17 18:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881

            Bug ID: 97881
           Summary: [11 Regression] ICE in warn_about_ambiguous_parse, at
                    cp/parser.c:20800
           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-alpha20201115 snapshot (g:c746fc40f4ec8cfc1092efd49d567751858d2099)
ICEs when compiling the following testcase, reduced from test/Sema/atomic-ops.c
from the clang 10.0.1 test suite:

void
cb ()
{
  volatile _Atomic (int) a1;
}

% g++-11.0.0 -c s10c4xmn.c
s10c4xmn.c: In function 'void a1()':
s10c4xmn.c:4:24: internal compiler error: in warn_about_ambiguous_parse, at
cp/parser.c:20800
    4 |   volatile _Atomic (int) cb;
      |                        ^
0x663c63 warn_about_ambiguous_parse
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:20800
0x9fb8b9 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:21084
0x9d9676 cp_parser_simple_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13943
0x9f654d cp_parser_declaration_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13342
0x9db49f cp_parser_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11588
0x9dc57d cp_parser_statement_seq_opt
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11954
0x9dc658 cp_parser_compound_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11904
0x9f66c4 cp_parser_function_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:23551
0x9f66c4 cp_parser_ctor_initializer_opt_and_function_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:23602
0x9fb199 cp_parser_function_definition_after_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29492
0x9fc529 cp_parser_function_definition_from_specifiers_and_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29408
0x9fc529 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:21124
0x9d9676 cp_parser_simple_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13943
0xa06564 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13640
0xa06f19 cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:4806
0xa06f19 c_parse_file()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:44595
0xb2aa0d c_common_parse_file()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/c-family/c-opts.c:1196

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97881] [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
  2020-11-17 18:12 [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800 asolokha at gmx dot com
@ 2020-11-17 18:19 ` mpolacek at gcc dot gnu.org
  2020-11-18  8:20 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-17 18:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-11-17
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.0

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97881] [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
  2020-11-17 18:12 [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800 asolokha at gmx dot com
  2020-11-17 18:19 ` [Bug c++/97881] " mpolacek at gcc dot gnu.org
@ 2020-11-18  8:20 ` rguenth at gcc dot gnu.org
  2020-11-21 20:48 ` cvs-commit at gcc dot gnu.org
  2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-18  8:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97881] [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
  2020-11-17 18:12 [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800 asolokha at gmx dot com
  2020-11-17 18:19 ` [Bug c++/97881] " mpolacek at gcc dot gnu.org
  2020-11-18  8:20 ` rguenth at gcc dot gnu.org
@ 2020-11-21 20:48 ` cvs-commit at gcc dot gnu.org
  2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-21 20:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881

--- Comment #2 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:0999f26098598fe0a499c5b79ad23678ccfe583a

commit r11-5232-g0999f26098598fe0a499c5b79ad23678ccfe583a
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Nov 17 13:39:39 2020 -0500

    c++: Fix ICE-on-invalid with -Wvexing-parse [PR97881]

    This invalid (?) code broke my assumption that if decl_specifiers->type
    is null, there must be any type-specifiers.  Turn the assert into an if
    to fix this crash.

    gcc/cp/ChangeLog:

            PR c++/97881
            * parser.c (warn_about_ambiguous_parse): Only assume "int" if we
            actually saw any type-specifiers.

    gcc/testsuite/ChangeLog:

            PR c++/97881
            * g++.dg/warn/Wvexing-parse9.C: New test.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/97881] [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
  2020-11-17 18:12 [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-11-21 20:48 ` cvs-commit at gcc dot gnu.org
@ 2020-11-21 20:50 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-21 20:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-21 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 18:12 [Bug c++/97881] New: [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800 asolokha at gmx dot com
2020-11-17 18:19 ` [Bug c++/97881] " mpolacek at gcc dot gnu.org
2020-11-18  8:20 ` rguenth at gcc dot gnu.org
2020-11-21 20:48 ` cvs-commit at gcc dot gnu.org
2020-11-21 20:50 ` 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).