This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

compile/20011114-1.c, any clues?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]