tail call optimization vs. debugging

Richard Henderson rth@cygnus.com
Sat Mar 25 11:35:00 GMT 2000


On Sat, Mar 25, 2000 at 12:18:25PM -0500, Geert Bosch wrote:
> Here are a few yes/no debugging questions that popped up for me:
>   - Will function breakpoints be hit by a tail call or sibcall? 

Yes.

>   - In recursive functions, will printing arguments show the argument values
>     of the last (recursive) call?

On pure tail calls, yes.  The new arguments get put exactly where
they should have been for a normal call.

With tail recursion (which we had before, but will trigger more often
now) I can only say "probably".  It's implemented with a goto internally,
so the optimizer has the chance to not put the new arguments in place.

>   - Do cases where unbounded recursion (due to tail call optimizations)
>     only show a few frames in a trace-back always use bounded stack space?

Eh?  If I understand the question correctly, of course.
How else could it be a tail call optimization?


r~


More information about the Gcc mailing list