aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c20
1 files changed, 17 insertions, 3 deletions
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;