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]

addresses of labels don't work with today's CVS source


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.

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