summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-02 07:03:15 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-02 07:03:15 +0000
commit072ec6eb6d08384ac2b31616e1438af18c382a6c (patch)
treeb3e82e3cba97dcee5b7ae4802423eec91c41f503 /gcc/ipa-prop.h
parentbd274446e8f86d1ff8e328e51b67484ed2310737 (diff)
downloadgcc-072ec6eb6d08384ac2b31616e1438af18c382a6c.tar.gz
* ipa-prop.h (ipa_get_controlled_uses): Add hack to avoid ICE
when speculation is added. (ipa_edge_args): Add polymorphic_call_contexts. (ipa_get_ith_polymorhic_call_context): New accesor. (ipa_make_edge_direct_to_target): Add SPECULATIVE parameter. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Print contexts. (ipa_compute_jump_functions_for_edge): Compute contexts. (update_jump_functions_after_inlining): Update contexts. (ipa_make_edge_direct_to_target): Add SPECULATIVE argument; update dumping; add speculative edge creation. (try_make_edge_direct_virtual_call): Add CTX_PTR parameter; handle context updating. (update_indirect_edges_after_inlining): Pass down context. (ipa_edge_duplication_hook): Duplicate contexts. (ipa_write_node_info): Stream out contexts. (ipa_read_node_info): Stream in contexts. * ipa-devirt.c (type_all_derivations_known_p): Avoid ICE on non-ODR types. (try_speculative_devirtualization): New function. * ipa-utils.h (try_speculative_devirtualization): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 27a1697d082..7a06af9958b 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -432,7 +432,10 @@ ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
static inline int
ipa_get_controlled_uses (struct ipa_node_params *info, int i)
{
- return info->descriptors[i].controlled_uses;
+ /* FIXME: introducing speuclation causes out of bounds access here. */
+ if (info->descriptors.length () > (unsigned)i)
+ return info->descriptors[i].controlled_uses;
+ return IPA_UNDESCRIBED_USE;
}
/* Set the controlled counter of a given parameter. */
@@ -479,6 +482,7 @@ struct GTY(()) ipa_edge_args
{
/* Vector of the callsite's jump function of each parameter. */
vec<ipa_jump_func, va_gc> *jump_functions;
+ vec<ipa_polymorphic_call_context, va_gc> *polymorphic_call_contexts;
};
/* ipa_edge_args access functions. Please use these to access fields that
@@ -502,6 +506,16 @@ ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
return &(*args->jump_functions)[i];
}
+/* Returns a pointer to the polymorphic call context for the ith argument.
+ NULL if contexts are not computed. */
+static inline struct ipa_polymorphic_call_context *
+ipa_get_ith_polymorhic_call_context (struct ipa_edge_args *args, int i)
+{
+ if (!args->polymorphic_call_contexts)
+ return NULL;
+ return &(*args->polymorphic_call_contexts)[i];
+}
+
/* Types of vectors holding the infos. */
/* Vector where the parameter infos are actually stored. */
@@ -585,7 +599,8 @@ tree ipa_get_indirect_edge_target (struct cgraph_edge *ie,
vec<tree> ,
vec<tree> ,
vec<ipa_agg_jump_function_p> );
-struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree);
+struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree,
+ bool speculative = false);
tree ipa_binfo_from_known_type_jfunc (struct ipa_jump_func *);
tree ipa_impossible_devirt_target (struct cgraph_edge *, tree);