Those cases you mentioned may lead to problems in inlining, indirect
target promotion transformations etc too, so it is better to use the
new guard against them.

David

On Fri, May 31, 2013 at 1:15 AM, Duncan Sands <baldr...@free.fr> wrote:
> Hi Dehao,
>
>
> On 31/05/13 00:47, Dehao Chen wrote:
>>
>> This patch makes more strict check of call args to make sure the
>> number of args match.
>>
>> Bootstrapped and passed regression tests.
>
>
> did you thoroughly test Fortran?  The Fortran front-end has long had an
> unfortunate tendency to eg declare a function as taking 4 int arguments,
> but in the call pass it one argument (an array of length 4, consisting
> of ints).  It would be great if all such nastiness has been fixed.  There
> are also a few cases in which it declares a builtin as taking, say, an
> int,float pair, but passes a float,int pair in the call.  I fixed a couple
> of instances of this a while back, but I still have one outstanding patch.
>
> Ciao, Duncan.
>
>
>>
>> OK for google branches?
>>
>> Thanks,
>> Dehao
>>
>> Index: gcc/gimple-low.c
>> ===================================================================
>> --- gcc/gimple-low.c (revision 199414)
>> +++ gcc/gimple-low.c (working copy)
>> @@ -254,9 +254,13 @@ gimple_check_call_args (gimple stmt, tree fndecl)
>>     && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
>>               return false;
>>    }
>> +      if (p != NULL)
>> + return false;
>>       }
>>     else if (parms)
>>       {
>> +      if (list_length (parms) - nargs != 1)
>> + return false;
>>         for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
>>    {
>>     tree arg;
>>
>

Reply via email to