diff options
author | Jan Hubicka <jh@suse.cz> | 2013-09-23 18:54:34 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-09-23 16:54:34 +0000 |
commit | 450ad0cd441aa2da250c2ca84e8005cb3a2d38e3 (patch) | |
tree | aa313df8c645e4e1d249c3df18ae10900ad40a7e /gcc/ipa-devirt.c | |
parent | dfff7c46929d43dac828cd232c231dcb5bd7653a (diff) | |
download | gcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.zip gcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.tar.gz gcc-450ad0cd441aa2da250c2ca84e8005cb3a2d38e3.tar.bz2 |
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
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 85bc5b0..c610e7b 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; } |