public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
@ 2020-08-03 16:55 haoxintu at gmail dot com
  2020-08-03 19:40 ` [Bug c++/96440] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: haoxintu at gmail dot com @ 2020-08-03 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96440
           Summary: ICE in tree check: expected tree_list, have error_mark
                    in get_attribute_name, at attribs.c:841
           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 code, reduced by C-Vise, makes GCC-trunk ICE and makes released GCC
versions "confused by early errors".

Input:
//small.cc
auto alignas a [[]] [[const]] ();

Command:
g++ small.cc

Output:
small.cc:1:14: error: expected ‘(’ before ‘a’
    1 | auto alignas a [[]] [[const]] ();
      |              ^
      |              (
small.cc:1:29: internal compiler error: tree check: expected tree_list, have
error_mark in get_attribute_name, at attribs.c:841
    1 | auto alignas a [[]] [[const]] ();
      |                             ^
0x7c7fd7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:9687
0x6a0bd3 tree_check(tree_node const*, char const*, int, char const*, tree_code)
        ../../gcc/tree.h:3559
0x6a0bd3 get_attribute_name(tree_node const*)
        ../../gcc/attribs.c:841
0xa9e159 private_lookup_attribute(char const*, unsigned long, tree_node*)
        ../../gcc/attribs.c:1812
0x911518 lookup_attribute
        ../../gcc/attribs.h:179
0x911518 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../gcc/cp/decl.c:11384
0x91d418 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/cp/decl.c:5233
0x9cbd7d cp_parser_init_declarator
        ../../gcc/cp/parser.c:20858
0x9ac3cc cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13811
0x9d763e cp_parser_declaration
        ../../gcc/cp/parser.c:13510
0x9d7d2b cp_parser_translation_unit
        ../../gcc/cp/parser.c:4793
0x9d7d2b c_parse_file()
        ../../gcc/cp/parser.c:44081
0xaf2e9d c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1188
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.

My gcc version is
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
--prefix=/home/haoxin/corpus-compilers/gcc-trunk/gcc-master/build/
--enable-languages=c,c++ CC=gcc CXX=g++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200801 (experimental) (GCC) 


Thanks,
Haoxin

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

* [Bug c++/96440] [8/9/10/11 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
@ 2020-08-03 19:40 ` mpolacek at gcc dot gnu.org
  2020-08-04  6:01 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-08-03 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |8.5
     Ever confirmed|0                           |1
            Summary|ICE in tree check: expected |[8/9/10/11 Regression] ICE
                   |tree_list, have error_mark  |in tree check: expected
                   |in get_attribute_name, at   |tree_list, have error_mark
                   |attribs.c:841               |in get_attribute_name, at
                   |                            |attribs.c:841
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-08-03
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Regressed with r193029.

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

* [Bug c++/96440] [8/9/10/11 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
  2020-08-03 19:40 ` [Bug c++/96440] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2020-08-04  6:01 ` rguenth at gcc dot gnu.org
  2021-05-14  9:53 ` [Bug c++/96440] [9/10/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-08-04  6:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug c++/96440] [9/10/11/12 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
  2020-08-03 19:40 ` [Bug c++/96440] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
  2020-08-04  6:01 ` rguenth at gcc dot gnu.org
@ 2021-05-14  9:53 ` jakub at gcc dot gnu.org
  2021-06-01  8:18 ` 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-05-14  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug c++/96440] [9/10/11/12 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2021-05-14  9:53 ` [Bug c++/96440] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:18 ` rguenth at gcc dot gnu.org
  2022-03-07 13:06 ` roger at nextmovesoftware dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

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

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

* [Bug c++/96440] [9/10/11/12 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
                   ` (3 preceding siblings ...)
  2021-06-01  8:18 ` rguenth at gcc dot gnu.org
@ 2022-03-07 13:06 ` roger at nextmovesoftware dot com
  2022-03-08 23:35 ` cvs-commit at gcc dot gnu.org
  2022-03-09 16:04 ` roger at nextmovesoftware dot com
  6 siblings, 0 replies; 8+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-03-07 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roger at nextmovesoftware dot com
             Status|NEW                         |ASSIGNED
           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/591293.html

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

* [Bug c++/96440] [9/10/11/12 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
                   ` (4 preceding siblings ...)
  2022-03-07 13:06 ` roger at nextmovesoftware dot com
@ 2022-03-08 23:35 ` cvs-commit at gcc dot gnu.org
  2022-03-09 16:04 ` 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:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:e52af9cac7fa7409c78c9f336dc1da57750c9766

commit r12-7552-ge52af9cac7fa7409c78c9f336dc1da57750c9766
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Tue Mar 8 23:33:46 2022 +0000

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

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

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

    gcc/cp/ChangeLog
            PR c++/96440
            * decl.cc (start_decl): Defend against prefix_attributes being
            error_mark_node.

    gcc/testsuite/ChangeLog
            PR c++/96440
            * g++.dg/cpp0x/pr96440.C: New test case.

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

* [Bug c++/96440] [9/10/11/12 Regression] ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841
  2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
                   ` (5 preceding siblings ...)
  2022-03-08 23:35 ` cvs-commit at gcc dot gnu.org
@ 2022-03-09 16:04 ` roger at nextmovesoftware dot com
  6 siblings, 0 replies; 8+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-03-09 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

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

--- 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:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 16:55 [Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841 haoxintu at gmail dot com
2020-08-03 19:40 ` [Bug c++/96440] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-08-04  6:01 ` rguenth at gcc dot gnu.org
2021-05-14  9:53 ` [Bug c++/96440] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:18 ` rguenth at gcc dot gnu.org
2022-03-07 13:06 ` roger at nextmovesoftware dot com
2022-03-08 23:35 ` cvs-commit at gcc dot gnu.org
2022-03-09 16:04 ` 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).