This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: AVR indirect_jump addresses limited to 16 bits
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: "Paul Schlie" <schlie at comcast dot net>
- Cc: "Marek Michalkiewicz" <marekm at amelek dot gda dot pl>,<gcc at gcc dot gnu dot org>
- Date: Sun, 20 Mar 2005 02:58:29 +0100
- Subject: Re: AVR indirect_jump addresses limited to 16 bits
- References: <20050319205239.GA25003@amelek.gda.pl> <BE620604.986E%schlie@comcast.net>
Paul Schlie <schlie@comcast.net> wrote:
> - Sorry, I'm confused; can you give me an example of legal C
> expression specifying an indirect jump to an arbitrary location
> within a function?
It is possible in GNU C at least:
int foo(int dest)
{
__label__ l1, l2, l3;
void *lb[] = { &&l1, &&l2, &&l3 };
int x = 0;
goto *lb[dest];
l1:
x += 1;
l2:
x += 1;
l3:
x += 1;
return x;
}
I would not design a backend so that such a feature is deemed to be impossible
to support.
Giovanni Bajo