This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Are 'goto' + trampolines broken?
- From: Richard Henderson <rth at redhat dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 14 May 2005 12:29:10 -0700
- Subject: Re: Are 'goto' + trampolines broken?
- References: <1116064768.30951.18.camel@localhost.localdomain>
On Sat, May 14, 2005 at 11:59:28AM +0200, Øyvind Harboe wrote:
> void test(void (*t)(void))
> {
> int i;
> for (i=0; i<10; i++)
> {
> t();
...
> int skip=0xdeadbeef;
>
> void do_goto (void)
> {
> goto l1;
> }
>
> test(do_goto);
...
> l1:
> if (skip!=0xdeadbeef)
> }
>
> int main ()
> {
> recursive (10, abort);
> abort ();
> }
Well of course your program always aborts. Control never enters
the recursive part of recursive(). It flows straight through and
returns, which hits the abort in main.
r~