Alan Modra via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> This moves an #ifdef block of code from calls.c to
> targetm.function_ok_for_sibcall.  Only two targets, x86 and rs6000,
> define REG_PARM_STACK_SPACE or OUTGOING_REG_PARM_STACK_SPACE macros
> that might vary depending on the called function.  Macros like
> UNITS_PER_WORD don't change over a function boundary, nor does the
> MIPS ABI, nor does TARGET_64BIT on PA-RISC.  Other targets are even
> more trivially seen to not need the calls.c code.
>
> Besides cleaning up a small piece of #ifdef code, the motivation for
> this patch is to allow tail calls on PowerPC for functions that
> require less reg_parm_stack_space than their caller.  The original
> code in calls.c only permitted tail calls when exactly equal.
Is there something PowerPC-specific that makes the relaxation safe
for that target while not being safe on x86?

I take your point about x86 and PowerPC being the only two affected
targets.  But the interface does still take an fndecl on all targets,
so I think the target-independent assumption should be that the value
might vary depending on function.  So I guess an alternative would be
to relax the target-independent condition and make the x86 hook enforce
the stricter condition (if it really is needed).

Thanks,
Richard

Reply via email to