Patchwork [GOOGLE] More strict checking for call args

login
register
mail settings
Submitter Dehao Chen
Date May 31, 2013, 12:11 a.m.
Message ID <CAO2gOZWkJuyFa-Kw=gAyarkXhXcaH2huz19Wvwx_gCZ-UOmXdg@mail.gmail.com>
Download mbox | patch
Permalink /patch/247818/
State New
Headers show

Comments

Dehao Chen - May 31, 2013, 12:11 a.m.
Yes, patch updated:

Testing on-going.

Dehao


On Thu, May 30, 2013 at 4:10 PM, Xinliang David Li <davidxl@google.com> wrote:
> On Thu, May 30, 2013 at 3:47 PM, Dehao Chen <dehao@google.com> wrote:
>> This patch makes more strict check of call args to make sure the
>> number of args match.
>>
>> Bootstrapped and passed regression tests.
>>
>> 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;
>
> This does not seem to be correct for vararg functions.
>
> David
>
>
>>        for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
>>   {
>>    tree arg;

Patch

Index: gimple-low.c
===================================================================
--- gimple-low.c (revision 199414)
+++ gimple-low.c (working copy)
@@ -254,6 +254,8 @@ 
   && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
             return false;
  }
+      if (p != NULL)
+ return false;
     }
   else if (parms)
     {