avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Now to do Tail Recursions?


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] Now to do Tail Recursions?
Date: Mon, 30 Aug 2004 11:21:16 -0700 (PDT)

On Mon, 30 Aug 2004, Bob Paddock wrote:

>
> Some gcc targets have an option of "-mtail-call" to optimize
> calls followed immediately by a return into a jump to the subroutine.
>
> Example:
>
> rcall hex8
> ret
>
> becomes
>
> rjmp hex8

Wouldn't you risk currupting your stack doing this? If the function you
did this from has an epilogue which pops some registers that where
pushed in the prologue, you would not return properly from hex8().


---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]