From 3339f0bcb06a145e127e5274e223827a6aeb3cb0 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 29 Jul 2014 11:39:06 +0200 Subject: cgraph.c (cgraph_node::create_indirect_edge): Copy speculative data. * cgraph.c (cgraph_node::create_indirect_edge): Copy speculative data. * cgraph.h (cgraph_indirect_call_info): Add speculative data. * gimple-fold.c (fold_gimple_assign): Fix check for virtual call. * ipa-devirt.c (ipa_dummy_polymorphic_call_context): Update (contains_type_p): Forward declare. (polymorphic_call_target_hasher::hash): Hash speculative info. (polymorphic_call_target_hasher::equal): Compare speculative info. (get_class_context): Handle speuclation. (contains_type_p): Update. (get_polymorphic_call_info_for_decl): Update. (walk_ssa_copies): Break out from ... (get_polymorphic_call_info): ... here; set speculative context before giving up. * ipa-prop.c (ipa_write_indirect_edge_info, ipa_read_indirect_edge_info): Stream speculative context. * ipa-utils.h (ipa_polymorphic_call_context): Add speculative info (SPECULATIVE_OFFSET, SPECULATIVE_OUTER_TYPE, SPECULATIVE_MAYBE_DERIVED_TYPE). (possible_polymorphic_call_targets overriders): Update. (dump_possible_polymorphic_call_targets overriders): Update. (dump_possible_polymorphic_call_target_p overriders): Update. From-SVN: r213152 --- gcc/cgraph.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index f8f76c4..d8651e2 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1243,11 +1243,11 @@ struct GTY(()) cgraph_indirect_call_info was actually used in the polymorphic resides within a larger structure. If agg_contents is set, the field contains the offset within the aggregate from which the address to call was loaded. */ - HOST_WIDE_INT offset; + HOST_WIDE_INT offset, speculative_offset; /* OBJ_TYPE_REF_TOKEN of a polymorphic call (if polymorphic is set). */ HOST_WIDE_INT otr_token; /* Type of the object from OBJ_TYPE_REF_OBJECT. */ - tree otr_type, outer_type; + tree otr_type, outer_type, speculative_outer_type; /* Index of the parameter that is called. */ int param_index; /* ECF flags determined from the caller. */ @@ -1270,6 +1270,7 @@ struct GTY(()) cgraph_indirect_call_info unsigned by_ref : 1; unsigned int maybe_in_construction : 1; unsigned int maybe_derived_type : 1; + unsigned int speculative_maybe_derived_type : 1; }; struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgraph_edge { -- cgit v1.1