Re: GCC does not cope with my code

Geert Bosch <bosch@nile.gnat.com>
4 Jun 2000 10:59:34 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: GCC does not cope with my code rus@tamu.edu (Silvius Rus) (2000-05-28)
Re: GCC does not cope with my code bonzini@gnu.org (2000-05-28)
Re: GCC does not cope with my code gnb@itga.com.au (Gregory Bond) (2000-05-28)
Re: GCC does not cope with my code J.Scheerder@cwi.nl (2000-05-28)
Re: GCC does not cope with my code Wilco.Dijkstra@arm.com (Wilco Dijkstra) (2000-05-28)
Re: GCC does not cope with my code braung@ert.rwth-aachen.de (Gunnar Braun) (2000-05-31)
Re: GCC does not cope with my code bosch@nile.gnat.com (Geert Bosch) (2000-06-04)
| List of all articles for this month |
From: Geert Bosch <bosch@nile.gnat.com>
Newsgroups: comp.compilers
Date: 4 Jun 2000 10:59:34 -0400
Organization: Compilers Central
References: 00-05-091 00-05-117
Keywords: C, GCC

GCC has an extension that allows one to use labels as values. You
can get its address using the && operator, so you can define
      static void *array[] = { &&foo, && bar, &&hack };
and then use a computed goto:
      goto *array[i];


This seems to fit your code quite well, and the optimizer might
handle this better, as this construct was implemented for this kind
of application. See the GCC manual for more ideas and details.


    -Geert





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.