From 450ad0cd441aa2da250c2ca84e8005cb3a2d38e3 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 23 Sep 2013 18:54:34 +0200 Subject: ipa-cp.c (ipa_get_indirect_edge_target_1): Add sanity check for ipa-devirt. * ipa-cp.c (ipa_get_indirect_edge_target_1): Add sanity check for ipa-devirt. * ipa-utils.h (possible_polymorphic_call_target_p): New function. * ipa-devirt.c (possible_polymorphic_call_target_p): Be tolerant of external calls * gimple-fold.c: Include ipa-utils.h and gimple-pretty-print.h (gimple_fold_call): Dump inconsistent devirtualizations; add sanity check for type based devirtualizations. * ipa-prop.c: Include ipa-utils.h (ipa_intraprocedural_devirtualization): Add sanity check. (try_make_edge_direct_virtual_call): Likewise. From-SVN: r202837 --- gcc/ipa-utils.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/ipa-utils.h') diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index d6f390d..27949e1 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -108,6 +108,19 @@ possible_polymorphic_call_target_p (struct cgraph_edge *e, return possible_polymorphic_call_target_p (e->indirect_info->otr_type, e->indirect_info->otr_token, n); } + +/* Return true if N can be possibly target of a polymorphic call of + OBJ_TYPE_REF expression CALL. */ + +inline bool +possible_polymorphic_call_target_p (tree call, + struct cgraph_node *n) +{ + return possible_polymorphic_call_target_p (obj_type_ref_class (call), + tree_low_cst + (OBJ_TYPE_REF_TOKEN (call), 1), + n); +} #endif /* GCC_IPA_UTILS_H */ -- cgit v1.1