2014-05-15 Martin Jambor <mjambor@suse.cz>
PR ipa/61085
* ipa-prop.c (update_indirect_edges_after_inlining): Check
type_preserved flag when the indirect edge is polymorphic.
testsuite/
* g++.dg/ipa/pr61085.C: New test.
From-SVN: r210477
+2014-05-15 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/61085
+ * ipa-prop.c (update_indirect_edges_after_inlining): Check
+ type_preserved flag when the indirect edge is polymorphic.
+
2014-05-15 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/61090
else if (jfunc->type == IPA_JF_PASS_THROUGH
&& ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{
- if (ici->agg_contents
- && !ipa_get_jf_pass_through_agg_preserved (jfunc))
+ if ((ici->agg_contents
+ && !ipa_get_jf_pass_through_agg_preserved (jfunc))
+ || (ici->polymorphic
+ && !ipa_get_jf_pass_through_type_preserved (jfunc)))
ici->param_index = -1;
else
ici->param_index = ipa_get_jf_pass_through_formal_id (jfunc);
}
else if (jfunc->type == IPA_JF_ANCESTOR)
{
- if (ici->agg_contents
- && !ipa_get_jf_ancestor_agg_preserved (jfunc))
+ if ((ici->agg_contents
+ && !ipa_get_jf_ancestor_agg_preserved (jfunc))
+ || (ici->polymorphic
+ && !ipa_get_jf_ancestor_type_preserved (jfunc)))
ici->param_index = -1;
else
{
+2014-05-15 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/61085
+ * g++.dg/ipa/pr61085.C: New test.
+
2014-05-15 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/61090
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-early-inlining" } */
+
+struct A {};
+struct B : virtual A {
+ unsigned m_i;
+ B() : m_i () {}
+ virtual A *m_virt ()
+ {
+ return 0;
+ }
+ ~B ()
+ {
+ m_foo ();
+ while (m_i)
+ ;
+ }
+ void m_foo ()
+ {
+ m_virt ();
+ }
+};
+
+class C : B {
+ A *m_virt () {
+ __builtin_abort ();
+ }
+};
+
+int main ()
+{
+ C c;
+}