On Tue, Jun 4, 2013 at 2:55 AM, Dehao Chen <[email protected]> wrote:
> Hi,
>
> This patch was committed to google branch. But I think it is of
> general interest. So is it ok for trunk?
>
> Thanks,
> Dehao
>
> gcc/ChangeLog:
>
> 2013-06-03 Dehao Chen <[email protected]>
>
> *gimple-low.c (gimple_check_call_args): Restrict the call_arg check to
> contain same number of args.
>
> Index: gcc/gimple-low.c
> ===================================================================
> --- gcc/gimple-low.c (revision 199570)
> +++ gcc/gimple-low.c (working copy)
> @@ -243,6 +243,8 @@ gimple_check_call_args (gimple stmt, tree fndecl)
> && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
> return false;
> }
> + if (p != NULL)
> + return false;
Please add a comment here, like
/* Not enough parameters to the function call. */
if (p != NULL)
return false;
note that I believe we can deal with this situation just fine during inlining,
we just leave the parameters uninitialized.
So - why do you think the test is a good idea? The whole function should
ideally be not necessary and is just there to avoid situations we cannot
deal with during inlining.
Richard.
> }
> else if (parms)
> {