From a33c028eb38268b5084ebc4cc17a1cb64b3a838b Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 27 Oct 2019 09:11:57 +0100 Subject: ipa-cp.c (propagate_constants_across_call): If args are not available just drop everything to varying. * ipa-cp.c (propagate_constants_across_call): If args are not available just drop everything to varying. (find_aggregate_values_for_callers_subset): Watch for missing edge summary. (find_more_scalar_values_for_callers_subs): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge, update_jump_functions_after_inlining, propagate_controlled_uses): Watch for missing summaries. (ipa_propagate_indirect_call_infos): Remove summary after propagation is finished. (ipa_write_node_info): Watch for missing summaries. (ipa_read_edge_info): Create new ref. (ipa_edge_args_sum_t): Add remove. (IPA_EDGE_REF_GET_CREATE): New macro. * ipa-fnsummary.c (evaluate_properties_for_edge): Watch for missing edge summary. (remap_edge_change_prob): Likewise. From-SVN: r277484 --- gcc/ipa-cp.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'gcc/ipa-cp.c') diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index f5852dc..23028e2 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -2309,10 +2309,17 @@ propagate_constants_across_call (struct cgraph_edge *cs) callee_info = IPA_NODE_REF (callee); args = IPA_EDGE_REF (cs); - args_count = ipa_get_cs_argument_count (args); parms_count = ipa_get_param_count (callee_info); if (parms_count == 0) return false; + if (!args) + { + for (i = 0; i < parms_count; i++) + ret |= set_all_contains_variable (ipa_get_parm_lattices (callee_info, + i)); + return ret; + } + args_count = ipa_get_cs_argument_count (args); /* If this call goes through a thunk we must not propagate to the first (0th) parameter. However, we might need to uncover a thunk from below a series @@ -4066,7 +4073,8 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, if (IPA_NODE_REF (cs->caller)->node_dead) continue; - if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)) + if (!IPA_EDGE_REF (cs) + || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)) || (i == 0 && call_passes_through_thunk_p (cs))) { @@ -4135,7 +4143,8 @@ find_more_contexts_for_caller_subset (cgraph_node *node, FOR_EACH_VEC_ELT (callers, j, cs) { - if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))) + if (!IPA_EDGE_REF (cs) + || i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))) return; ipa_jump_func *jfunc = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i); @@ -4451,6 +4460,11 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, FOR_EACH_VEC_ELT (callers, j, cs) { + if (!IPA_EDGE_REF (cs)) + { + count = 0; + break; + } int c = ipa_get_cs_argument_count (IPA_EDGE_REF (cs)); if (c < count) count = c; -- cgit v1.1