From 6fe459553452ee75e87959331db336a1152d9451 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Wed, 24 Sep 2014 19:49:16 +0200 Subject: [PATCH] ipa-prop.c (ipa_edge_duplication_hook): Update controlled_use_count when duplicating a PASS_THROUGH jump function when... 2014-09-24 Martin Jambor * ipa-prop.c (ipa_edge_duplication_hook): Update controlled_use_count when duplicating a PASS_THROUGH jump function when creating a speculative edge. From-SVN: r215560 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-prop.c | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 30f713cd65d..1755c0ff55b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-24 Martin Jambor + + * ipa-prop.c (ipa_edge_duplication_hook): Update controlled_use_count + when duplicating a PASS_THROUGH jump function when creating a + speculative edge. + 2014-09-24 Marek Polacek PR c/61405 diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index d790e448177..9c7aaf7b899 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -3640,6 +3640,21 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, dst_jf->value.constant.rdesc = dst_rdesc; } } + else if (dst_jf->type == IPA_JF_PASS_THROUGH + && src->caller == dst->caller) + { + struct cgraph_node *inline_root = dst->caller->global.inlined_to + ? dst->caller->global.inlined_to : dst->caller; + struct ipa_node_params *root_info = IPA_NODE_REF (inline_root); + int idx = ipa_get_jf_pass_through_formal_id (dst_jf); + + int c = ipa_get_controlled_uses (root_info, idx); + if (c != IPA_UNDESCRIBED_USE) + { + c++; + ipa_set_controlled_uses (root_info, idx, c); + } + } } }