summaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-23 16:54:34 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-23 16:54:34 +0000
commit10fba9c02e052ec5274554138a6624e5576a15f2 (patch)
treeaa313df8c645e4e1d249c3df18ae10900ad40a7e /gcc/ipa-devirt.c
parentac8d08a3c98897e7a17f42910956c07fd14ea06e (diff)
downloadgcc-10fba9c02e052ec5274554138a6624e5576a15f2.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202837 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 85bc5b0652b..c610e7bd14d 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -905,13 +905,19 @@ possible_polymorphic_call_target_p (tree otr_type,
{
vec <cgraph_node *> targets;
unsigned int i;
+ bool final;
if (!odr_hash.is_created ())
return true;
- targets = possible_polymorphic_call_targets (otr_type, otr_token);
+ targets = possible_polymorphic_call_targets (otr_type, otr_token, &final);
for (i = 0; i < targets.length (); i++)
if (n == targets[i])
return true;
+
+ /* At a moment we allow middle end to dig out new external declarations
+ as a targets of polymorphic calls. */
+ if (!final && !n->symbol.definition)
+ return true;
return false;
}