aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2010-12-15 14:19:46 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2010-12-15 14:19:46 +0100
commitceeffab0ba9cd6133a07c97df3c374d7b39dadee (patch)
tree526589a7e9753bc7a413ea63388bd8d0aa594f12 /gcc/tree-ssa-ccp.c
parent9d0dcda15ccb43b5b24b370e793142736d5742d3 (diff)
downloadgcc-ceeffab0ba9cd6133a07c97df3c374d7b39dadee.zip
gcc-ceeffab0ba9cd6133a07c97df3c374d7b39dadee.tar.gz
gcc-ceeffab0ba9cd6133a07c97df3c374d7b39dadee.tar.bz2
re PR tree-optimization/46053 (g++.dg/torture/pr45699.C FAILs with -fno-early-inlining)
2010-12-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46053 PR middle-end/46287 PR middle-end/46242 * cgraph.h (cgraph_indirect_call_info): New field thunk_delta. * gimple.h (gimple_fold_obj_type_ref): Declaration removed. (gimple_fold_call): Declare. (gimple_adjust_this_by_delta): Likewise. * cgraph.c (cgraph_make_edge_direct): New parameter delta. Updated all users. (cgraph_clone_edge): Create a copy of indirect_info also for direct edges. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Adjust this parameters. * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Renamed to gimple_get_virt_mehtod_for_binfo, new parameter delta. Do not search through thunks, in fact bail out if we encounter one, check that BINFO_VIRTUALS is not NULL. (gimple_adjust_this_by_delta): New function. (gimple_fold_obj_type_ref): Removed. (gimple_fold_obj_type_ref_call): New function. (fold_gimple_call): Renamed to gimple_fold_call, made external. Updated users. Call gimple_fold_obj_type_ref_call instead of gimple_fold_obj_type_ref. * ipa-cp.c (ipcp_process_devirtualization_opportunities): Process thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): New parameter delta. Updated callers. (ipa_write_indirect_edge_info): Stream thunk_delta. (ipa_read_indirect_edge_info): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Use gimple_fold_call instead of gimple_fold_obj_type_ref. * testsuite/g++.dg/ipa/pr46053.C: New test. * testsuite/g++.dg/ipa/pr46287-1.C: Likewise. * testsuite/g++.dg/ipa/pr46287-2.C: Likewise. * testsuite/g++.dg/ipa/pr46287-3.C: Likewise. * testsuite/g++.dg/torture/covariant-1.C: Likewise. * testsuite/g++.dg/torture/pr46287.C: Likewise. From-SVN: r167855
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 30a0e14..aea7edf 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2316,16 +2316,8 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
{
tree expr = OBJ_TYPE_REF_EXPR (callee);
OBJ_TYPE_REF_EXPR (callee) = valueize_op (expr);
- if (TREE_CODE (OBJ_TYPE_REF_EXPR (callee)) == ADDR_EXPR)
- {
- tree t;
- t = gimple_fold_obj_type_ref (callee, NULL_TREE);
- if (t)
- {
- gimple_call_set_fn (stmt, t);
- changed = true;
- }
- }
+ if (gimple_fold_call (gsi, false))
+ changed = true;
OBJ_TYPE_REF_EXPR (callee) = expr;
}