This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Issues with intraprocedural devirtualization
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Jason Merrill <jason at redhat dot com>, rguenther at suse dot de, gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Aug 2013 17:05:54 +0200
- Subject: Re: [RFC] Issues with intraprocedural devirtualization
- References: <20130817214457 dot GA7313 at kam dot mff dot cuni dot cz> <52101BC9 dot 3090801 at redhat dot com> <20130818085303 dot GB16557 at kam dot mff dot cuni dot cz> <20130818085527 dot GC16557 at kam dot mff dot cuni dot cz> <20130819091031 dot GA12549 at kam dot mff dot cuni dot cz>
On Mon, Aug 19, 2013 at 11:10:31AM +0200, Jan Hubicka wrote:
> here is variant of patch that drops the field walking from
> gimple_extract_devirt_binfo_from_cst completely. As pointed out
> by Jason, it is pointless since all structures have BINFO in C++
> and thus get_binfo_at_offset will do the job.
> I would like to return the code back eventually to handle arrays&unions
> but that can be done incrementally (and this is not the only place that
> sufers from the problem)
> Martin: I am still not quite certain about the dynamic type changing logic.
> if this is the case ipa-prop needs to deal with and it handles only 0 offsets
> within the outer type, I guess it can just test the offset by itself?
In these cases, devirtualization is done according ipa invariants, no
dynamic type checks are in place, we did away with requiring the
artificial-ness of the field we devirtualize according to.
I believe your new check that the function has not been overridden is
sufficient and superior.
> Bootstrapped/regtested x86_64-linux, OK?
> * ipa-cp.c (ipa_get_indirect_edge_target_1): Update use
> of gimple_extract_devirt_binfo_from_cst.
> * gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Rework.
> (gimple_fold_call): Update use of gimple_extract_devirt_binfo_from_cst.
> * ipa-prop.c (try_make_edge_direct_virtual_call): Likewise.
> * gimple.h (gimple_extract_devirt_binfo_from_cst): Update.