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

            Bug ID: 122350
           Summary: internal compiler error: in reshape_init_r, at
                    cp/decl.cc:7598
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qingren2hxb at gmail dot com
  Target Milestone: ---

Created attachment 62587
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62587&action=edit
bug report by using -freport-bug

========================================
$g++ -v
Using built-in specs.
COLLECT_GCC=/workspace/installation/bin/g++
COLLECT_LTO_WRAPPER=/workspace/installation/libexec/gcc/x86_64-pc-linux-gnu/15.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /workspace/gcc/configure --prefix=/workspace/installation
--enable-coverage --enable-checking --disable-multilib --disable-shared
--disable-bootstrap --enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (GCC)
========================================
// test.C
#include <stdio.h>
typedef int V __attribute__((__vector_size__(16), __may_alias__));
struct s {
    V v[2];
};
int main() {
    struct s s = {{.v = {0}}};  
    int i;
    return 0;
}
========================================
$ g++ test.C
test.C: In function 'int main()':
test.C:7:29: error: name 'v' used in a GNU-style designated initializer for an
array
    7 |     struct s s = {{.v = {0}}};
      |                             ^
test.C:7:29: internal compiler error: in reshape_init_r, at cp/decl.cc:7598
0x5d4e2e6 internal_error(char const*, ...)
        /workspace/gcc/gcc/diagnostic-global-context.cc:517
0x5cf3c1f fancy_abort(char const*, int, char const*)
        /workspace/gcc/gcc/diagnostic.cc:1749
0x10f04ae reshape_init_r
        /workspace/gcc/gcc/cp/decl.cc:7598
0x10ec941 reshape_init_array_1
        /workspace/gcc/gcc/cp/decl.cc:7026
0x10ed199 reshape_init_array
        /workspace/gcc/gcc/cp/decl.cc:7097
0x10f07bf reshape_init_r
        /workspace/gcc/gcc/cp/decl.cc:7627
0x10f0f1d reshape_init(tree_node*, tree_node*, int)
        /workspace/gcc/gcc/cp/decl.cc:7712
0x10f05e0 reshape_init_r
        /workspace/gcc/gcc/cp/decl.cc:7611
0x10ee3b9 reshape_init_class
        /workspace/gcc/gcc/cp/decl.cc:7325
0x10f075f reshape_init_r
        /workspace/gcc/gcc/cp/decl.cc:7625
0x10f0f1d reshape_init(tree_node*, tree_node*, int)
        /workspace/gcc/gcc/cp/decl.cc:7712
0x10f2a88 check_initializer
        /workspace/gcc/gcc/cp/decl.cc:7911
0x1101823 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        /workspace/gcc/gcc/cp/decl.cc:9201
0x13f6217 cp_parser_init_declarator
        /workspace/gcc/gcc/cp/parser.cc:24290
0x13d7ba7 cp_parser_simple_declaration
        /workspace/gcc/gcc/cp/parser.cc:16528
0x13d731e cp_parser_block_declaration
        /workspace/gcc/gcc/cp/parser.cc:16347
0x13d349b cp_parser_declaration_statement
        /workspace/gcc/gcc/cp/parser.cc:15444
0x13c977c cp_parser_statement
        /workspace/gcc/gcc/cp/parser.cc:13285
0x13cbd30 cp_parser_statement_seq_opt
        /workspace/gcc/gcc/cp/parser.cc:13859
0x13cb541 cp_parser_compound_statement
        /workspace/gcc/gcc/cp/parser.cc:13706
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to