diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-07-11 19:36:35 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-07-11 17:36:35 +0000 |
commit | 01a92e704282e69fc3ec7d817637b8074454168d (patch) | |
tree | cc8b8a6e54f1d43a8820123980f3ef960194ad28 /gcc/ipa-cp.c | |
parent | 12b308fa865bb6ac7f30671e332ec17926556da4 (diff) | |
download | gcc-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.c | 13 |
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)); |