[PATCH 1/2] can_implement_as_sibling_call_p REG_PARM_STACK_SPACE check V2

Segher Boessenkool segher@kernel.crashing.org
Mon Nov 2 21:14:21 GMT 2020


Hi!

On Mon, Nov 02, 2020 at 08:16:16PM +1030, Alan Modra wrote:
> The no function change patch.
> 
> 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 proven to not need the calls.c code.

Just the rs6000 part:

> +  /* If outgoing reg parm stack space changes, we cannot do sibcall.  */
> +  if ((OUTGOING_REG_PARM_STACK_SPACE (fntype)
> +       != OUTGOING_REG_PARM_STACK_SPACE (TREE_TYPE (current_function_decl)))
> +      || (REG_PARM_STACK_SPACE (decl ? decl : fntype)
> +	  != REG_PARM_STACK_SPACE (current_function_decl)))

Please don't use superfluous parens, like (a) || (b) here, it makes
things harder to read than necessary.

Other than that this patch is fine.  Thanks!


Segher


More information about the Gcc-patches mailing list