This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
addresses of labels don't work with today's CVS source
- To: gcc-bugs at gcc dot gnu dot org
- Subject: addresses of labels don't work with today's CVS source
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Wed, 3 May 2000 14:24:50 -0500 (EST)
- Cc: lucier at math dot purdue dot edu, matzmich at cs dot tu-berlin dot de, rth at cygnus dot com
With this compiler:
popov-189% /export/u10/egcs-profile/bin/gcc -v
Reading specs from /export/u10/egcs-profile/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.96/specs
gcc version 2.96 20000503 (experimental)
with this input:
int test (int i)
{
static void * labels[] =
{
&&label_1,
&&label_2
};
goto *(labels[i]);
label_1:
return 1;
label_2:
return 2;
}
I get these messages, which I think is an error:
popov-188% /export/u10/egcs-profile/bin/gcc -c test.c
test.c: In function `test':
test.c:5: initializer element is not computable at load time
test.c:5: (near initialization for `labels[0]')
test.c:7: initializer element is not computable at load time
test.c:7: (near initialization for `labels[1]')
I'm no expert on computed gotos, but this worked with yesterday's source
and with 2.95.1. If there is indeed a problem, perhaps this test should
be added to the test suite.
Brad Lucier
PS: This problem does not allow me to test Michael Matz's proposed
patch to flow.c.