This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33316] New: [4.2.1 regression] ICE on valid variable-length automatic array in const struct
- From: "radford at blackbean dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2007 20:13:51 -0000
- Subject: [Bug c/33316] New: [4.2.1 regression] ICE on valid variable-length automatic array in const struct
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following gives an ICE when compiled with -g. Removing -g, removing the
const or making data[] a constant size will allow it to be compiled.
int f(void *p, int length)
{
const struct {
int data[length];
} *array = p;
return array[0].data[0];
}
$ gcc -g -c t.c
t.c: In function ?f?:
t.c:8: internal compiler error: Segmentation fault
$ gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --enable-languages=c
Thread model: posix
gcc version 4.2.1
--
Summary: [4.2.1 regression] ICE on valid variable-length
automatic array in const struct
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: radford at blackbean dot org
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33316