This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Sat, 11 Mar 2006 00:41:32 -0000
- Subject: FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
Morning all!
Sorry to bore everyone with old-fashioned 3.x stuff :) but I was just
wondering if there's a little loophole here that I may have fallen into?
----------------------------<snip>----------------------------
`FUNCTION_OK_FOR_SIBCALL (DECL)'
A C expression that evaluates to true if it is ok to perform a
sibling call to DECL from the current function.
It is not uncommon for limitations of calling conventions to
prevent tail calls to functions outside the current unit of
translation, or during PIC compilation. Use this macro to enforce
these restrictions, as the `sibcall' md pattern can not fail, or
fall over to a "normal" call.
----------------------------<snip>----------------------------
As I understand it, stack frame layout is iteratively converged on in a
process that repeatedly calls I_F_P_O, and the final frame size isn't known
for sure until the final iteration of this process, yes?
However F_O_F_S is called much earlier on in function compilation, before
I_F_P_O is even called once.
So, what if the decision it needs to make depends on the stack frame size of
the current function? The comment above suggests that we can't say OK to it
now and refuse to match the sibcall_epilog pattern later by testing in the
pattern condition whether the stack frame size is in range and refusing to
match if so, as it says we can't fall back. And we can't test this condition
at F_O_F_S time, because the stack frame size is still unknown.
Is this right? Is get_frame_size() valid at F_O_F_S time, so that we can at
least take a best-guess at the final frame size?
cheers,
DaveK
--
Can't think of a witty .sigline today....