This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Track dynamic type changes
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 24 Nov 2014 08:40:27 -0800
- Subject: Re: Track dynamic type changes
- Authentication-results: sourceware.org; auth=none
- References: <20141005163449 dot GA31829 at kam dot mff dot cuni dot cz>
On Sun, Oct 5, 2014 at 9:34 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch makes ipa_polymorphic_call_context::get_dynamic_type to
> track if vptr has changed in between function entry and polymorphic
> call.
>
> The patch also add logic skipping if (a==0) checks in multiple
> inheritance so I can construct testcase more easily.
>
> I got my SVN tree into an inconsistent state yesterday by stopping in
> middle of commit. The patch went in in two parts, so i am attaching
> both changes. Quite few of devirt-4*.C was broken overnight, I apologize
> for that.
>
> Honza
>
> * ipa-polymorphic-call.c (walk_ssa_copies): Recognize
> NULL pointer checks.
> (ipa_polymorphic_call_context::get_dynamic_type): Return true
> if type doesn't change.
> * cgraph.h (cgraph_indirect_call_info): New flag.
> * cgraph.c (cgraph_node::create_indirect_edge): Initialize it.
> (cgraph_node::dump): Dump it.
> * ipa-prop.c (ipa_analyze_call_uses): Ignore return valud
> of context.get_dynamic_type.
> (ipa_make_edge_direct_to_target): Do not speculate
> edge that is already speuclative.
> (try_make_edge_direct_virtual_call): Use VPTR_CHANGED; Do not
> speculate to __builtin_unreachable
> (ipa_write_indirect_edge_info, ipa_read_indirect_edge_info): Stream
> vptr_changed.
> * ipa-cp.c (ipa_get_indirect_edge_target_1): Use vptr_changed.
> * g++.dg/ipa/devirt-47.C: New testcase.
>
> * ipa-polymorphic-call.c (possible_placement_new): Fix condition
> on size.
> (ipa_polymorphic_call_context::restrict_to_inner_type): Do not walk
> into vptr pointer.
> (ipa_polymorphic_call_context::dump): Fix formating.
> * ipa-prop.c (ipa_analyze_call_uses): Compute vptr_changed.
>
This caused:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64049
--
H.J.