aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-07-11 19:36:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-07-11 17:36:35 +0000
commit01a92e704282e69fc3ec7d817637b8074454168d (patch)
treecc8b8a6e54f1d43a8820123980f3ef960194ad28 /gcc/ipa-cp.c
parent12b308fa865bb6ac7f30671e332ec17926556da4 (diff)
downloadgcc-01a92e704282e69fc3ec7d817637b8074454168d.zip
gcc-01a92e704282e69fc3ec7d817637b8074454168d.tar.gz
gcc-01a92e704282e69fc3ec7d817637b8074454168d.tar.bz2
ipa-prop.c (ipa_binfo_from_known_type_jfunc): In LTO do not walk non-polymorphic types.
* ipa-prop.c (ipa_binfo_from_known_type_jfunc): In LTO do not walk non-polymorphic types. * ipa-cp.c (ipa_get_jf_ancestor_result): Likewise. * ipa-devirt.c (types_same_for_odr): Do not explode when one of types is not polymorphic. From-SVN: r212466
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index b6d66d9..224b03a 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -789,6 +789,19 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
{
if (!ipa_get_jf_ancestor_type_preserved (jfunc))
return NULL;
+ /* FIXME: At LTO we can't propagate to non-polymorphic type, because
+ we have no ODR equivalency on those. This should be fixed by
+ propagating on types rather than binfos that would make type
+ matching here unnecesary. */
+ if (in_lto_p
+ && (TREE_CODE (ipa_get_jf_ancestor_type (jfunc)) != RECORD_TYPE
+ || !TYPE_BINFO (ipa_get_jf_ancestor_type (jfunc))
+ || !BINFO_VTABLE (TYPE_BINFO (ipa_get_jf_ancestor_type (jfunc)))))
+ {
+ if (!ipa_get_jf_ancestor_offset (jfunc))
+ return input;
+ return NULL;
+ }
return get_binfo_at_offset (input,
ipa_get_jf_ancestor_offset (jfunc),
ipa_get_jf_ancestor_type (jfunc));