public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
@ 2020-07-27  9:40 haoxintu at gmail dot com
  2020-07-27 10:19 ` [Bug c++/96329] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: haoxintu at gmail dot com @ 2020-07-27  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96329
           Summary: [11 Regression] ICE : tree check: expected string_cst,
                    have error_mark in cp_parser_linkage_specification, at
                    cp/parser.c:14640
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi, all.

This simple invalide code makes GCC ICE.

Input:
//test.cc
extern "C" ""a

Command:
g++ test.cc

Output:
test.cc:1:12: error: unable to find string literal operator ‘operator""a’ with
‘const char [2]’, ‘long unsigned int’ arguments
    1 | extern "C" ""a
      |            ^~~
test.cc:1:12: internal compiler error: tree check: expected string_cst, have
error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
0x7c524f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:9685
0x64d693 cp_parser_linkage_specification
        ../../gcc/tree.h:3301
0x9cfa9a cp_parser_declaration
        ../../gcc/cp/parser.c:13421
0x9d015a cp_parser_translation_unit
        ../../gcc/cp/parser.c:4761
0x9d015a c_parse_file()
        ../../gcc/cp/parser.c:44043
0xae920b c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1190
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.

I tested in GCC trunk 20200726, and it seems not to make GCC-10 or downwards 
versions crashed. 

Thanks,
Haoxin

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

* [Bug c++/96329] [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
@ 2020-07-27 10:19 ` marxin at gcc dot gnu.org
  2020-07-27 12:46 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-27 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-07-27

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, ICEs for all revisions I have (4.8.0) with -std=c++14.

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

* [Bug c++/96329] [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
  2020-07-27 10:19 ` [Bug c++/96329] " marxin at gcc dot gnu.org
@ 2020-07-27 12:46 ` rguenth at gcc dot gnu.org
  2021-04-27 11:39 ` [Bug c++/96329] [11/12 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-27 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
           Priority|P3                          |P4

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

* [Bug c++/96329] [11/12 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
  2020-07-27 10:19 ` [Bug c++/96329] " marxin at gcc dot gnu.org
  2020-07-27 12:46 ` rguenth at gcc dot gnu.org
@ 2021-04-27 11:39 ` jakub at gcc dot gnu.org
  2021-07-28  7:04 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-27 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.0                        |11.2

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.1 has been released, retargeting bugs to GCC 11.2.

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

* [Bug c++/96329] [11/12 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2021-04-27 11:39 ` [Bug c++/96329] [11/12 " jakub at gcc dot gnu.org
@ 2021-07-28  7:04 ` rguenth at gcc dot gnu.org
  2022-03-07 13:03 ` roger at nextmovesoftware dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28  7:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.2                        |11.3

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.2 is being released, retargeting bugs to GCC 11.3

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

* [Bug c++/96329] [11/12 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
                   ` (3 preceding siblings ...)
  2021-07-28  7:04 ` rguenth at gcc dot gnu.org
@ 2022-03-07 13:03 ` roger at nextmovesoftware dot com
  2022-03-08 23:19 ` cvs-commit at gcc dot gnu.org
  2022-03-09 16:01 ` roger at nextmovesoftware dot com
  6 siblings, 0 replies; 8+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-03-07 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |roger at nextmovesoftware dot com
           Assignee|unassigned at gcc dot gnu.org      |roger at nextmovesoftware dot com

--- Comment #4 from Roger Sayle <roger at nextmovesoftware dot com> ---
Patch proposed.
https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591291.html

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

* [Bug c++/96329] [11/12 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
                   ` (4 preceding siblings ...)
  2022-03-07 13:03 ` roger at nextmovesoftware dot com
@ 2022-03-08 23:19 ` cvs-commit at gcc dot gnu.org
  2022-03-09 16:01 ` roger at nextmovesoftware dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-08 23:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:8ab72ec7c456c92989276f17fe0ae90a56932149

commit r12-7549-g8ab72ec7c456c92989276f17fe0ae90a56932149
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Tue Mar 8 23:18:34 2022 +0000

    PR c++/96329: ICE-on-invalid-code error recovery.

    This patch fixes PR c++/96329 which is an ICE-on-invalid-code regression
    affecting mainline.

    2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/cp/ChangeLog
            PR c++/96329
            * parser.cc (cp_parser_linkage_specification): Treat the case where
            linkage is error_mark_node as "invalid linkage-specification".

    gcc/testsuite/ChangeLog
            PR c++/96329
            * g++.dg/template/pr96329.C: New test case.

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

* [Bug c++/96329] [11/12 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
  2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
                   ` (5 preceding siblings ...)
  2022-03-08 23:19 ` cvs-commit at gcc dot gnu.org
@ 2022-03-09 16:01 ` roger at nextmovesoftware dot com
  6 siblings, 0 replies; 8+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-03-09 16:01 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|11.3                        |12.0
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Roger Sayle <roger at nextmovesoftware dot com> ---
This should now be fixed on mainline.

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

end of thread, other threads:[~2022-03-09 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27  9:40 [Bug c++/96329] New: [11 Regression] ICE : tree check: expected string_cst, have error_mark in cp_parser_linkage_specification, at cp/parser.c:14640 haoxintu at gmail dot com
2020-07-27 10:19 ` [Bug c++/96329] " marxin at gcc dot gnu.org
2020-07-27 12:46 ` rguenth at gcc dot gnu.org
2021-04-27 11:39 ` [Bug c++/96329] [11/12 " jakub at gcc dot gnu.org
2021-07-28  7:04 ` rguenth at gcc dot gnu.org
2022-03-07 13:03 ` roger at nextmovesoftware dot com
2022-03-08 23:19 ` cvs-commit at gcc dot gnu.org
2022-03-09 16:01 ` roger at nextmovesoftware dot com

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).