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

            Bug ID: 78647
           Summary: ICE on invalid C++ code on x86_64-linux-gnu (internal
                    compiler error: tree check: expected tree_list, have
                    error_mark in get_attribute_name, at attribs.c:664)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20161202 (experimental) [trunk revision 243153] (GCC) 
$ 
$ gcc-trunk small.C
small.C: In function ‘void f()’:
small.C:3:35: error: expected primary-expression before ‘)’ token
 void f() { alignas(do_not_remove(A)); }
                                   ^
small.C:3:37: internal compiler error: tree check: expected tree_list, have
error_mark in get_attribute_name, at attribs.c:664
 void f() { alignas(do_not_remove(A)); }
                                     ^
0x10a150c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc-source-trunk/gcc/tree.c:9814
0x8e5445 tree_check
        ../../gcc-source-trunk/gcc/tree.h:3302
0x8e5445 get_attribute_name(tree_node const*)
        ../../gcc-source-trunk/gcc/attribs.c:664
0x10a3645 private_lookup_attribute(char const*, unsigned long, tree_node*)
        ../../gcc-source-trunk/gcc/tree.c:6100
0x914ab3 lookup_attribute
        ../../gcc-source-trunk/gcc/tree.h:4163
0x914ab3 attribute_fallthrough_p(tree_node*)
        ../../gcc-source-trunk/gcc/c-family/c-common.c:5561
0x7ca009 cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10696
0x7cb22c cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:11019
0x7cb31f cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10973
0x7c5e1f cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21357
0x7c5e1f cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21393
0x7c6701 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26151
0x7c7939 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26063
0x7c7939 cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19109
0x7c7db9 cp_parser_simple_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12764
0x7c8a21 cp_parser_block_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12591
0x7cf850 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12488
0x7cfc54 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12364
0x7cff98 cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4368
0x7cff98 c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:38262
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 
$ cat small.C
struct A;
void do_not_remove();
void f() { alignas(do_not_remove(A)); }
$

Reply via email to