This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Gimple and tail calls
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 7 Nov 2003 15:37:28 -0800
- Subject: Re: [tree-ssa] Gimple and tail calls
- References: <20031107225040.GD27826@kam.mff.cuni.cz>
On Fri, Nov 07, 2003 at 11:50:40PM +0100, Jan Hubicka wrote:
> I would like to ask for opinions on representation. I've added an new
> flag to CALL_EXPR (CALL_EXPR_TAILCALL) signalizing calls that can be
> converted to tail calls and the tail recognizer updates CFG in a way we
> do for tail calls in GCC (removing edges out of CFG, adding abnormal
> sibcall edge to exit).
No. CALL_EXPR_TAILCALL can only mean that there are no external
dataflow reasons that the tail call might fail. Conversion to
tailcall can still fail for target-specific reasons.
I expect these to mostly due to parameter passing. Either not
enough stack space for the called function's parameters, or
strange parameter overlap. Other ABI bits can be checked earlier.
> The actual problem is that some tail calls returns return value of
> CALL_EXPR, while other do not (either because function return NULL or
> undefined value).
So? Why is this a problem?
> TO represnet this I can nest CALL_EXPR with CALL_EXPR_TAILCALL inside
> RETURN_EXPR. Does this sound like sane extension of GIMPLE?
No.
r~