compile/20011114-1.c, any clues?
Zack Weinberg
zack@codesourcery.com
Sun Dec 16 13:13:00 GMT 2001
I'm getting
FAIL: gcc.c-torture/compile/20011114-1.c, -O0
FAIL: gcc.c-torture/compile/20011114-1.c, -O1
FAIL: gcc.c-torture/compile/20011114-1.c, -O2
FAIL: gcc.c-torture/compile/20011114-1.c, -O3 -fomit-frame-pointer
FAIL: gcc.c-torture/compile/20011114-1.c, -O3 -g
FAIL: gcc.c-torture/compile/20011114-1.c, -Os
on i386. The error message in all cases is
20011114-1.c:2: initializer element is not computable at load time
The source code after preprocessing is
extern void _text;
static unsigned int x = (unsigned int) &_text - 0x10000000L - 1;
The very similar 20010327-1.c
extern void _text;
static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;
gets no complaints at all. This is a 32-bit architecture,
sizeof(int) == sizeof(long) == sizeof (void *).
[Incidentally, why is
extern void _text;
accepted by the compiler even with -pedantic? void all by itself is
an incomplete type.]
zw
More information about the Gcc-bugs
mailing list