When is the stack pointer unreliable?
Jeffrey A Law
law@cygnus.com
Mon Sep 7 14:39:00 GMT 1998
In message < 199809070123.VAA03584@jwlab.FEITH.COM >you write:
> >> Since reloading the stack pointer causes a stall on some processors
> >> it should be avoided when possible. Under what situations is sp
> >> unreliable?
> > alloca calls,
>
> In which case current_function_calls_alloca is set.
Right.
> > variable sized objects in the stack come immediately to mind.
>
> I assume that this is always handled by allocate_dynamic_stack_space
> in which case current_function_calls_alloca is set.
Correct.
> > You might also need to check if the compiler has optimized away
> > popping of args after a function call if we unconditionally reach the
> > epilogue after performing the call.
>
> Good point. That hadn't occurred to me.
I think this is controlled by EXIT_IGNORE_STACK or something like
that. I don't know if any state is kept about whether or not that
optimization was performed.
jeff
More information about the Gcc
mailing list