This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR ipa/59831 (ipa-cp devirt issues)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Feb 2014 00:47:30 +0100
- Subject: Re: PR ipa/59831 (ipa-cp devirt issues)
- Authentication-results: sourceware.org; auth=none
- References: <20140131062254 dot GA28026 at kam dot mff dot cuni dot cz> <20140204231712 dot GA17343 at virgil dot suse>
> > - if (TREE_CODE (t) != TREE_BINFO)
> > + /* Try to work out BINFO from virtual table pointer value in replacements. */
> > + if (!t && agg_reps && !ie->indirect_info->by_ref)
>
> At this point you know that !ie->indirect_info->polymorphic is set and
> thus ie->indirect_info->by_ref is always false because it really has
> no meaning (it is only meaningful when agg_contents is set which is
> mutually exclusive with the polymorphic flag).
I was worried here about case where in future we may want to represent call of
virtual methods from pointers passed by reference (i.e. in some other object).
We don't do that at the moment, but for that would really need better jump
functions.
If you preffer, I can remove that check.
Honza
>
> > {
> > - tree binfo;
> > - binfo = gimple_extract_devirt_binfo_from_cst
> > - (t, ie->indirect_info->otr_type);
> > - if (!binfo)
> > + while (agg_reps)
> > + {
> > + if (agg_reps->index == param_index
> > + && agg_reps->offset == ie->indirect_info->offset
> > + && agg_reps->by_ref)
> > + {
> > + debug_tree (t);
> > + t = agg_reps->value;
> > + t = vtable_pointer_value_to_binfo (t);
> > + break;
> > + }
> > + agg_reps = agg_reps->next;
> > + }
> > + }
> > +
> > + /* Try to work out BINFO from virtual table pointer value in known
> > + known aggregate values. */
> > + if (!t && known_aggs.length () > (unsigned int) param_index
> > + && !ie->indirect_info->by_ref)
>
> The same here.
>
> Thanks,
>
> Martin