From: Richard Biener Date: Mon, 15 Dec 2014 18:33:16 +0000 (+0000) Subject: re PR tree-optimization/64312 (ICE: Segmentation fault) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76be46db72595b894a6e6da15e892d4a1f8f91cf;p=gcc.git re PR tree-optimization/64312 (ICE: Segmentation fault) 2014-12-15 Richard Biener PR tree-optimization/64312 * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Use vuse_ssa_val as callback to walk_non_aliased_vuses. (vn_reference_lookup): Likewise. * g++.dg/torture/pr64312.C: New testcase. From-SVN: r218756 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c5a5a37ed15..3d10b30f849 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Richard Biener + + PR tree-optimization/64312 + * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Use + vuse_ssa_val as callback to walk_non_aliased_vuses. + (vn_reference_lookup): Likewise. + 2014-12-15 Segher Boessenkool * gcc/config/rs6000/rs6000.md (*add>mode>3_imm_dot, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 75e15d034c7..af88c0aada9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Richard Biener + + PR tree-optimization/64312 + * g++.dg/torture/pr64312.C: New testcase. + 2014-12-15 Paolo Carlini PR c++/58882 diff --git a/gcc/testsuite/g++.dg/torture/pr64312.C b/gcc/testsuite/g++.dg/torture/pr64312.C new file mode 100644 index 00000000000..dc3e95dbb94 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64312.C @@ -0,0 +1,123 @@ +// { dg-do compile } + +template struct A +{ + typedef typename C::iterator type; +}; +template struct B +{ + typedef T2 type; +}; +template struct L +{ + typedef typename B::type::type type; +}; +template struct M +{ + typedef typename L >::type type; +}; +class C +{ +public: + typedef int iterator; +}; +template class D +{ +public: + typedef IteratorT iterator; + template D (Iterator p1, Iterator) : m_Begin (p1), m_End (0) + { + } + IteratorT m_Begin; + IteratorT m_End; +}; +template class I : public D +{ +protected: + template + I (Iterator p1, Iterator p2) + : D (p1, p2) + { + } +}; +class F +{ +public: + int elems[]; + int * + m_fn1 () + { + return elems; + } +}; +class G +{ +public: + void * + m_fn2 (int) + { + return m_buffer.m_fn1 (); + } + F m_buffer; +}; +struct any_incrementable_iterator_interface +{ + virtual ~any_incrementable_iterator_interface () {} +}; +class J : public any_incrementable_iterator_interface +{ +public: + J (int) : m_it () {} + int m_it; +}; +void *operator new(__SIZE_TYPE__, void *p2) { return p2; } +template typename M::type begin (T) { return 0; } +template typename M::type end (T) {} +template class any_iterator +{ +public: + template any_iterator (WrappedIterator) + { + void *ptr = m_buffer.m_fn2 (0); + m_impl = new (ptr) J (0); + } + ~any_iterator () + { + if (m_impl) + m_impl->~any_incrementable_iterator_interface (); + } + G m_buffer; + any_incrementable_iterator_interface *m_impl; +}; +template class K : public I > +{ +public: + template + K (WrappedRange p1) + : I > (begin (p1), end (p1)) + { + } +}; +template struct H +{ + typedef K type; +}; +template +void +mix_values_impl () +{ + C test_data; + H::type source_data (test_data); + typename H::type t2 = source_data; +} +template +void +mix_values_driver () +{ + mix_values_impl (); +} +void +mix_values () +{ + mix_values_driver (); +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index d7a4742caf6..9902723b673 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -2161,7 +2161,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type, (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse, vn_reference_lookup_2, vn_reference_lookup_3, - vn_valueize, &vr1); + vuse_ssa_val, &vr1); gcc_checking_assert (vr1.operands == shared_lookup_references); } @@ -2214,7 +2214,7 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind, (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse, vn_reference_lookup_2, vn_reference_lookup_3, - vn_valueize, &vr1); + vuse_ssa_val, &vr1); gcc_checking_assert (vr1.operands == shared_lookup_references); if (wvnresult) {