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

            Bug ID: 127164
           Summary: ICE on valid static compound literal at function
                    prototype scope
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aaron at aaronballman dot com
  Target Milestone: ---

Consider the following terrible, contrived example:
```
void func(int x[(static int){12}]) {

}
```
This currently causes an ICE: https://godbolt.org/z/Y5K84WvG1
```
<source>:1:1: internal compiler error: Segmentation fault
    1 | void func(int x[(static int){12}]) {
      | ^~~~
0x2844868 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x28394ab internal_error(char const*, ...)
        ???:0
0xa7013b build_compound_literal(unsigned long, tree_node*, tree_node*, bool,
unsigned int, c_declspecs*)
        ???:0
0xb17340 c_parse_file()
        ???:0
0xb9ccc9 c_common_parse_file()
        ???:0
/cefs/41/417d0af575e3216d3bdabb64_gcc-trunk-20260831/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/41/417d0af575e3216d3bdabb64_gcc-trunk-20260831/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -masm=intel
-mtune=generic -march=x86-64 -g -fdiagnostics-color=always -fno-verbose-asm -o
/app/output.s
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.
Compiler returned: 1
```
This could be a duplicate of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109828 but I wasn't certain so I
filed it separately.

Reply via email to