aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-09-02 15:26:30 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2011-09-02 15:26:30 +0200
commit81fa35bd5991d39abb342bd655fbe8fc7b9b4026 (patch)
tree40b78961e6d8224638e16b90b5477c67f9a4ee1c /gcc/ipa-cp.c
parent5d882cc1dafe2546b34f1845f943b91f024dbac4 (diff)
downloadgcc-81fa35bd5991d39abb342bd655fbe8fc7b9b4026.zip
gcc-81fa35bd5991d39abb342bd655fbe8fc7b9b4026.tar.gz
gcc-81fa35bd5991d39abb342bd655fbe8fc7b9b4026.tar.bz2
cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta.
2011-09-02 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta. * gimple-fold.c (gimple_get_virt_method_for_binfo): Rewritten to use BINFO_VTABLE. Parameter delta removed, all callers updated. * tree.c (free_lang_data_in_binfo): Clear BINFO_VIRTUALs instead BINFO_VTABLE. * cgraph.c (cgraph_make_edge_direct): Removed parameter delta, updated all calls. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Removed handling of thunk_delta. * ipa-cp.c (get_indirect_edge_target): Removed parameter delta. (devirtualization_time_bonus): Do not handle thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. (input_edge_opt_summary): Likewise. * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not stream BINFO_VIRTUALS at all. * lto-streamer-in.c (lto_input_ts_binfo_tree_pointers): Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Added a distraction method. * testsuite/g++.dg/ipa/ivinline-7.C: Added a test for direct call discovery, xfailed test for inlining. * testsuite/g++.dg/ipa/ivinline-9.C: Likewise. From-SVN: r178472
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 94118b7..23eb1e2 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1110,11 +1110,10 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
/* If an indirect edge IE can be turned into a direct one based on KNOWN_VALS
(which can contain both constants and binfos) or KNOWN_BINFOS (which can be
- NULL) return the destination. If simple thunk delta must be applied too,
- store it to DELTA. */
+ NULL) return the destination. */
static tree
-get_indirect_edge_target (struct cgraph_edge *ie, tree *delta,
+get_indirect_edge_target (struct cgraph_edge *ie,
VEC (tree, heap) *known_vals,
VEC (tree, heap) *known_binfos)
{
@@ -1132,10 +1131,7 @@ get_indirect_edge_target (struct cgraph_edge *ie, tree *delta,
if (t &&
TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
- {
- *delta = NULL_TREE;
- return TREE_OPERAND (t, 0);
- }
+ return TREE_OPERAND (t, 0);
else
return NULL_TREE;
}
@@ -1159,7 +1155,7 @@ get_indirect_edge_target (struct cgraph_edge *ie, tree *delta,
binfo = get_binfo_at_offset (binfo, anc_offset, otr_type);
if (!binfo)
return NULL_TREE;
- return gimple_get_virt_method_for_binfo (token, binfo, delta);
+ return gimple_get_virt_method_for_binfo (token, binfo);
}
else
{
@@ -1168,7 +1164,7 @@ get_indirect_edge_target (struct cgraph_edge *ie, tree *delta,
binfo = get_binfo_at_offset (t, anc_offset, otr_type);
if (!binfo)
return NULL_TREE;
- return gimple_get_virt_method_for_binfo (token, binfo, delta);
+ return gimple_get_virt_method_for_binfo (token, binfo);
}
}
@@ -1187,9 +1183,9 @@ devirtualization_time_bonus (struct cgraph_node *node,
{
struct cgraph_node *callee;
struct inline_summary *isummary;
- tree delta, target;
+ tree target;
- target = get_indirect_edge_target (ie, &delta, known_csts, known_binfos);
+ target = get_indirect_edge_target (ie, known_csts, known_binfos);
if (!target)
continue;
@@ -1674,12 +1670,12 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node,
for (ie = node->indirect_calls; ie; ie = next_ie)
{
- tree delta, target;
+ tree target;
next_ie = ie->next_callee;
- target = get_indirect_edge_target (ie, &delta, known_vals, NULL);
+ target = get_indirect_edge_target (ie, known_vals, NULL);
if (target)
- ipa_make_edge_direct_to_target (ie, target, delta);
+ ipa_make_edge_direct_to_target (ie, target);
}
}