+2013-09-12 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/58389
+ * ipa-prop.c (remove_described_reference): Give up if the edge in the
+ reference descriptor is NULL.
+ (ipa_edge_removal_hook): If owning a reference descriptor, set its
+ edge to NULL.
+
2013-09-12 Andrew MacLeod <amacleod@redhat.com>
* tree-flow.h (FREE_SSANAMES): Move to tree-ssanames.c
struct cgraph_edge *origin;
origin = rdesc->cs;
+ if (!origin)
+ return false;
to_del = ipa_find_reference ((symtab_node) origin->caller, symbol,
origin->call_stmt, origin->lto_stmt_uid);
if (!to_del)
struct ipa_jump_func *jf;
int i;
FOR_EACH_VEC_ELT (*args->jump_functions, i, jf)
- try_decrement_rdesc_refcount (jf);
+ {
+ struct ipa_cst_ref_desc *rdesc;
+ try_decrement_rdesc_refcount (jf);
+ if (jf->type == IPA_JF_CONST
+ && (rdesc = ipa_get_jf_constant_rdesc (jf))
+ && rdesc->cs == cs)
+ rdesc->cs = NULL;
+ }
}
ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+template <typename _RandomAccessIterator, typename _Compare>
+void __insertion_sort(_RandomAccessIterator, _Compare);
+template <typename _RandomAccessIterator, typename _Compare>
+void __final_insertion_sort(_RandomAccessIterator p1, _Compare p2) {
+ _RandomAccessIterator a;
+ if (p1 - a)
+ ;
+ else
+ std:
+ __insertion_sort(0, p2);
+}
+template <typename _RandomAccessIterator, typename _Size, typename _Compare>
+void __introsort_loop(_RandomAccessIterator, _Size, _Compare);
+template <typename _RandomAccessIterator, typename _Compare>
+void sort(_RandomAccessIterator, _RandomAccessIterator p2, _Compare p3) {
+std:
+ __introsort_loop(0, 0, p3);
+ __final_insertion_sort(p2, p3);
+}
+class A {
+public:
+ int m_fn1();
+ void __lg();
+ class B {
+ public:
+ int i;
+ int operator-(B);
+ };
+};
+class C;
+class D {
+public:
+ C *operator->();
+};
+class F {
+ A m_fn1() const;
+ D d_ptr;
+};
+class C {
+ friend F;
+ void m_fn1();
+ A children;
+};
+void qt_notclosestLeaf();
+inline void C::m_fn1() {
+ A::B b, c;
+ if (children.m_fn1()) {
+ sort(c, b, qt_notclosestLeaf);
+ }
+}
+A F::m_fn1() const { const_cast<F *>(this)->d_ptr->m_fn1(); }