https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101437
Bug ID: 101437
Summary: [12 Regression] ICE: Segmentation fault signal
terminated program cc1
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: anbu1024.me at gmail dot com
Target Milestone: ---
$ cat test.c
struct s
{
unsigned int : 1;
};
inline static void foo(int x)
{
struct s this_struct = {.var = x};
*((volatile struct s *) 0x880000UL) = this_struct;
}
void bar()
{
foo(0);
}
--------------------------------
$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210711 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--------------------------------
$ gcc-sp12 test.c
test.c: In function ‘foo’:
test.c:9:28: error: ‘struct s’ has no member named ‘var’
9 | struct s this_struct = {.var = x};
| ^~~
test.c:9:34: warning: excess elements in struct initializer
9 | struct s this_struct = {.var = x};
| ^
test.c:9:34: note: (near initialization for ‘this_struct’)
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
--------------------------------
$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210710
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--------------------------------
$ gcc-sp11 test.c
test.c: In function ‘foo’:
test.c:9:28: error: ‘struct s’ has no member named ‘var’
9 | struct s this_struct = {.var = x};
| ^~~
test.c:9:34: warning: excess elements in struct initializer
9 | struct s this_struct = {.var = x};
| ^
test.c:9:34: note: (near initialization for ‘this_struct’)