aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-10-05 07:02:19 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-10-05 05:02:19 +0000
commit0127c169d155ecdad955d1b27cbc9e34ea981d42 (patch)
treed2428ebac5861155cb99905a9e92c774a2f64be7 /gcc/cgraph.c
parent2add94cd4415d64ea2a075abfa1ce74a9ee39053 (diff)
downloadgcc-0127c169d155ecdad955d1b27cbc9e34ea981d42.zip
gcc-0127c169d155ecdad955d1b27cbc9e34ea981d42.tar.gz
gcc-0127c169d155ecdad955d1b27cbc9e34ea981d42.tar.bz2
ipa-polymorphic-call.c (walk_ssa_copies): Recognize NULL pointer checks.
* ipa-polymorphic-call.c (walk_ssa_copies): Recognize NULL pointer checks. (ipa_polymorphic_call_context::get_dynamic_type): Return true if type doesn't change. * cgraph.h (cgraph_indirect_call_info): New flag. * cgraph.c (cgraph_node::create_indirect_edge): Initialize it. (cgraph_node::dump): Dump it. * ipa-prop.c (ipa_analyze_call_uses): Ignore return valud of context.get_dynamic_type. (ipa_make_edge_direct_to_target): Do not speculate edge that is already speuclative. (try_make_edge_direct_virtual_call): Use VPTR_CHANGED; Do not speculate to __builtin_unreachable (ipa_write_indirect_edge_info, ipa_read_indirect_edge_info): Stream vptr_changed. * ipa-cp.c (ipa_get_indirect_edge_target_1): Use vptr_changed. * g++.dg/ipa/devirt-47.C: New testcase. From-SVN: r215898
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index a46e188..38dc7e6 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -883,6 +883,7 @@ cgraph_node::create_indirect_edge (gimple call_stmt, int ecf_flags,
edge->indirect_info = cgraph_allocate_init_indirect_info ();
edge->indirect_info->ecf_flags = ecf_flags;
+ edge->indirect_info->vptr_changed = true;
/* Record polymorphic call info. */
if (compute_indirect_info
@@ -1988,6 +1989,8 @@ cgraph_node::dump (FILE *f)
edge->indirect_info->member_ptr ? "member ptr" : "aggregate",
edge->indirect_info->by_ref ? "passed by reference":"",
(int)edge->indirect_info->offset);
+ if (edge->indirect_info->vptr_changed)
+ fprintf (f, " (vptr maybe changed)");
}
fprintf (f, "\n");
if (edge->indirect_info->polymorphic)