[PATCH, Pointer Bounds Checker 21/x] Weakrefs output

Ilya Enkovich enkovich.gnu@gmail.com
Tue Jun 3 10:58:00 GMT 2014


2014-06-03 13:02 GMT+04:00 Richard Biener <richard.guenther@gmail.com>:
> On Mon, Jun 2, 2014 at 5:22 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> Hi,
>>
>> This patch prevents output of both instrumented and not instrumented weakref variants.
>
> Shouldn't one of them be reclaimed instead at some point?

Actually both version may be used.  We may have both instrumented and
not instrumented calls to the same function. Also original function
pointer may be used as value somewhere (e.g. in DECL_INIT).

Ilya

>
> Richard.
>
>> Thanks,
>> Ilya
>> --
>> gcc/
>>
>> 2014-06-02  Ilya Enkovich  <ilya.enkovich@intel.com>
>>
>>         * cgraphunit.c (output_weakrefs): If there are both
>>         instrumented and original versions, output only one
>>         of them.
>>
>>
>> diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
>> index c5c3333..ae9e699 100644
>> --- a/gcc/cgraphunit.c
>> +++ b/gcc/cgraphunit.c
>> @@ -2111,9 +2111,13 @@ static void
>>  output_weakrefs (void)
>>  {
>>    symtab_node *node;
>> +  cgraph_node *cnode;
>>    FOR_EACH_SYMBOL (node)
>>      if (node->alias
>>          && !TREE_ASM_WRITTEN (node->decl)
>> +       && (!(cnode = dyn_cast <cgraph_node> (node))
>> +           || !cnode->instrumented_version
>> +           || !TREE_ASM_WRITTEN (cnode->instrumented_version->decl))
>>         && node->weakref)
>>        {
>>         tree target;



More information about the Gcc-patches mailing list