aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-12-16 18:26:20 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-12-16 17:26:20 +0000
commit2994ab20f1702205ad1be6ef120d0460b236ae7c (patch)
treefdf0ac7629ddac3966a0a7ce9814ca63b3387581 /gcc/ipa-prop.c
parent8062bca66dc0acfaf7b5d2659ee5ca4381fea9e8 (diff)
downloadgcc-2994ab20f1702205ad1be6ef120d0460b236ae7c.zip
gcc-2994ab20f1702205ad1be6ef120d0460b236ae7c.tar.gz
gcc-2994ab20f1702205ad1be6ef120d0460b236ae7c.tar.bz2
ipa-cp.c (ipa_get_indirect_edge_target_1): Use can_refer; do not speculate to impossible targets.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Use can_refer; do not speculate to impossible targets. * ipa-prop.c (try_make_edge_direct_virtual_call): Likewise. From-SVN: r231705
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 72c2fed..0ab2427 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2898,18 +2898,22 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
true);
if (t && vtable_pointer_value_to_vtable (t, &vtable, &offset))
{
+ bool can_refer;
t = gimple_get_virt_method_for_vtable (ie->indirect_info->otr_token,
- vtable, offset);
- if (t)
+ vtable, offset, &can_refer);
+ if (can_refer)
{
- if ((TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE
- && DECL_FUNCTION_CODE (t) == BUILT_IN_UNREACHABLE)
+ if (!t
+ || (TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE
+ && DECL_FUNCTION_CODE (t) == BUILT_IN_UNREACHABLE)
|| !possible_polymorphic_call_target_p
(ie, cgraph_node::get (t)))
{
/* Do not speculate builtin_unreachable, it is stupid! */
if (!ie->indirect_info->vptr_changed)
target = ipa_impossible_devirt_target (ie, target);
+ else
+ target = NULL;
}
else
{