This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug in structure initialisation
- To: egcs-bugs at cygnus dot com
- Subject: Bug in structure initialisation
- From: Simon Marlow <simonm at dcs dot gla dot ac dot uk>
- Date: Thu, 11 Jun 1998 12:27:00 +0100
The following fragment illustrates a bug in egcs (2.91.28 19980508):
typedef struct {
} empty;
typedef struct {
int i;
empty e;
int i2;
} st;
st s = {
i : 0,
i2 : 1,
};
The assembler output is
.file "test.c"
gcc2_compiled.:
___gnu_compiled_c:
.globl _s
.data
.align 2,0x90
.type _s,@object
.size _s,8
_s:
.long 0
.space 4
The '1' in the second initialised field seems to have disappeared.
gcc 2.7.2 compiles this correctly. I've also seen the egcs fall over
with an internal error when presented with similar but more complex
examples, but I haven't narrowed it down to a small test case.
Cheers,
Simon
--
Simon Marlow simonm@dcs.gla.ac.uk
University of Glasgow http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key