aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorFeng Xue <fxue@os.amperecomputing.com>2020-01-24 23:09:28 +0800
committerFeng Xue <fxue@os.amperecomputing.com>2020-06-01 14:10:04 +0800
commit32633ec815b4d741a9a4b1b75de235844f6d691c (patch)
treea4bef1e46c28cb3795065c55562f3534a956682b /gcc/ipa-cp.c
parente7340ed74abf5f44b069210a9eb1283a2e515b15 (diff)
downloadgcc-32633ec815b4d741a9a4b1b75de235844f6d691c.zip
gcc-32633ec815b4d741a9a4b1b75de235844f6d691c.tar.gz
gcc-32633ec815b4d741a9a4b1b75de235844f6d691c.tar.bz2
Fix missed IPA-CP on by-ref argument directly passed through (PR 93429)
2020-06-01 Feng Xue <fxue@os.amperecomputing.com> gcc/ PR ipa/93429 * ipa-cp.c (propagate_aggs_across_jump_function): Check aggregate lattice for simple pass-through by-ref argument. gcc/testsuite/ PR ipa/93429 * gcc.dg/ipa/ipcp-agg-8.c: Change dump string. * gcc.dg/ipa/ipcp-agg-13.c: New test.
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index c64e910..b0c8f40 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -2735,9 +2735,8 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs,
gcc_assert (!jfunc->agg.items);
ret |= merge_aggregate_lattices (cs, dest_plats, src_plats,
src_idx, 0);
+ return ret;
}
- else
- ret |= set_agg_lats_contain_variable (dest_plats);
}
else if (jfunc->type == IPA_JF_ANCESTOR
&& ipa_get_jf_ancestor_agg_preserved (jfunc))
@@ -2759,8 +2758,10 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs,
ret |= set_agg_lats_to_bottom (dest_plats);
else
ret |= set_agg_lats_contain_variable (dest_plats);
+ return ret;
}
- else if (jfunc->agg.items)
+
+ if (jfunc->agg.items)
{
bool pre_existing = dest_plats->aggs != NULL;
struct ipcp_agg_lattice **aglat = &dest_plats->aggs;
@@ -4988,11 +4989,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index,
else
intersect_with_agg_replacements (cs->caller, src_idx,
&inter, 0);
- }
- else
- {
- inter.release ();
- return vNULL;
+ return inter;
}
}
else
@@ -5008,11 +5005,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index,
inter = copy_plats_to_inter (src_plats, 0);
else
intersect_with_plats (src_plats, &inter, 0);
- }
- else
- {
- inter.release ();
- return vNULL;
+ return inter;
}
}
}
@@ -5043,8 +5036,10 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index,
else
intersect_with_plats (src_plats, &inter, delta);
}
+ return inter;
}
- else if (jfunc->agg.items)
+
+ if (jfunc->agg.items)
{
class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
struct ipa_agg_value *item;