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

            Bug ID: 122348
           Summary: ICE: in store_constructor, at expr.cc:7565
           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 62585
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62585&action=edit
bug report by using -freport-bug

========================================
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-linux-gnu/15.1.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: /usr/src/gcc/configure --build=x86_64-linux-gnu
--disable-multilib --enable-languages=c,c++,fortran,go
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (GCC)
========================================
#include <stdio.h>

struct S {
    int a;
    int b[];
};

const struct S s = { 0, { 42 } };

void foo(struct S arg) {
    if (arg.b[0] != 42)
        printf("\n");
}

int main() {
    foo(s);
    return 0;
}
========================================
# g++ test.C
during RTL pass: expand
test.C: In function 'int main()':
test.C:16:8: internal compiler error: in store_constructor, at expr.cc:7565
   16 |     foo(s);
      |     ~~~^~~
0x232cd05 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x233cf0f internal_error(char const*, ...)
        ???:0
0x81a80d fancy_abort(char const*, int, char const*)
        ???:0
0xc708f9 emit_push_insn(rtx_def*, machine_mode, tree_node*, rtx_def*, unsigned
int, int, rtx_def*, poly_int<1u, long>, rtx_def*, rtx_def*, int, rtx_def*,
bool)
        ???:0
0xb3eec0 expand_call(tree_node*, rtx_def*, int)
        ???:0
0xc5f6b5 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ???:0
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