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

            Bug ID: 80972
           Summary: [7/8 Regression] ICE with alignas and
                    __attribute__((packed))
           Product: gcc
           Version: 8.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: ---

The testcase g++.dg/torture/pr80334.C triggers an ICE when compiled
with -std=c++1z since GCC 7.1.0. Here's an even shorter version:

======================================================
struct A { alignas(2) char c; };
struct B { A a; } __attribute__((packed));

A a = B().a;
======================================================

bug.cc:4:11: internal compiler error: in build_over_call, at cp/call.c:7989
 A a = B().a;
           ^
0x5fd0b5 build_over_call
        ../../gcc/gcc/cp/call.c:7986
0x5fdbbe build_new_method_call_1
        ../../gcc/gcc/cp/call.c:8823
0x5fdbbe build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc/gcc/cp/call.c:8892
0x5ff039 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:8421
0x671255 ocp_convert(tree_node*, tree_node*, int, int, int)
        ../../gcc/gcc/cp/cvt.c:893
0x6eb2b5 expand_default_init
        ../../gcc/gcc/cp/init.c:1788
0x6eb2b5 expand_aggr_init_1
        ../../gcc/gcc/cp/init.c:1967
0x6eba59 build_aggr_init(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/init.c:1705
0x687faf build_aggr_init_full_exprs
        ../../gcc/gcc/cp/decl.c:6127
0x687faf check_initializer
        ../../gcc/gcc/cp/decl.c:6275
0x6a91dc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6994
0x74f3e3 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19389
0x76e92c cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:12800
0x76f6c5 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12625
0x741b74 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12523
0x77753b cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12399
0x77781a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4364
0x77781a c_parse_file()
        ../../gcc/gcc/cp/parser.c:38475
0x8b9066 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

Reply via email to