ipa-polymorphic-call.c (walk_ssa_copies): Recognize NULL pointer checks.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 5 Oct 2014 05:02:19 +0000 (07:02 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 5 Oct 2014 05:02:19 +0000 (05:02 +0000)
commit0127c169d155ecdad955d1b27cbc9e34ea981d42
treed2428ebac5861155cb99905a9e92c774a2f64be7
parent2add94cd4415d64ea2a075abfa1ce74a9ee39053
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
gcc/ChangeLog
gcc/cgraph.c
gcc/cgraph.h
gcc/ipa-cp.c
gcc/ipa-polymorphic-call.c
gcc/ipa-prop.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/devirt-47.C [new file with mode: 0644]