2014-06-03 13:02 GMT+04:00 Richard Biener <richard.guent...@gmail.com>:
> On Mon, Jun 2, 2014 at 5:22 PM, Ilya Enkovich <enkovich....@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.enkov...@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;

Reply via email to