ipa-prop.c (ipa_edge_duplication_hook): Update controlled_use_count when duplicating...
authorMartin Jambor <mjambor@suse.cz>
Wed, 24 Sep 2014 17:49:16 +0000 (19:49 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 24 Sep 2014 17:49:16 +0000 (19:49 +0200)
2014-09-24  Martin Jambor  <mjambor@suse.cz>

* 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
gcc/ipa-prop.c

index 30f713cd65d0784081a852bc351b661b3d6fd60e..1755c0ff55bf76c6cd437b932880f8e7f10333c6 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-24  Martin Jambor  <mjambor@suse.cz>
+
+       * 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  <polacek@redhat.com>
 
        PR c/61405
index d790e4481772ed7f55362109b176ebe4e21ffb14..9c7aaf7b899517601760dae9ef394da451b3fb0d 100644 (file)
@@ -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);
+           }
+       }
     }
 }