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

            Bug ID: 79641
           Summary: [5/6/7 Regression] ICE with const variable and
                    attribute
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---
             Build: [

The following valid line of code triggers an ICE since GCC 4.2.0:

==============================================
const int __attribute__((mode (QI))) i = 0;
==============================================

bug.cc:1:38: internal compiler error: in start_decl, at cp/decl.c:5150
 const int __attribute__((mode (QI))) i = 0;
                                      ^
0x63673f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/gcc/cp/decl.c:5150
0x7195d7 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19273
0x73dc1c cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:12795
0x73e9c5 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12620
0x743d94 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12518
0x7459bb cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12394
0x745c9a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4366
0x745c9a c_parse_file()
        ../../gcc/gcc/cp/parser.c:38430
0x8a4de3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

The C-frontend compiles the code without problem.

Reply via email to