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

            Bug ID: 69914
           Summary: ICE in check_global_declaration, upon
                    -Wunused-variable of an array
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

With recent trunk@233620:

> $ cat test.c
> typedef struct S {
>   int a;
>   void * b;
>   int c;
> } S;
> void f(void) {
>     S a[] = {
>         {0x00000120, ((void *)0), 0},
>         {0x00000120, ((void *)0), 0},
>         {0x00000120, ((void *)0), 0},
>         {0x00000120, ((void *)0), 0},
>         {0, ((void *)0), 0},
>         {0, ((void *)0), 0}
>     };
> }

> $ gcc -Wunused-variable -c test.c
> test.c: In function ‘f’:
> test.c:7:7: warning: unused variable ‘a’ [-Wunused-variable]
>      S a[] = {
>        ^
> At top level:
> cc1: internal compiler error: Segmentation fault
> 0xb2497f crash_signal
>       ../../src/gcc/toplev.c:335
> 0x7506bd check_global_declaration
>       ../../src/gcc/cgraphunit.c:947
> 0x7506bd analyze_functions
>       ../../src/gcc/cgraphunit.c:1168
> 0x750f98 symbol_table::finalize_compilation_unit()
>       ../../src/gcc/cgraphunit.c:2537

Reply via email to