From: Richard Biener Date: Tue, 13 Jan 2015 08:32:13 +0000 (+0000) Subject: re PR middle-end/64568 (error: invalid reference prefix) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2d429ac5e450845f3febbfba21d3bb486fcf7ce;p=gcc.git re PR middle-end/64568 (error: invalid reference prefix) 2014-01-13 Richard Biener PR tree-optimization/64568 * tree-ssa-forwprop.c (pass_forwprop::execute): Properly release defs of removed stmts, avoid splitting TARGET_MEM_REFs. * g++.dg/torture/pr64568.C: New testcase. From-SVN: r219520 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d358973a59e..a3126a73ce7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-01-13 Richard Biener + + PR tree-optimization/64568 + * tree-ssa-forwprop.c (pass_forwprop::execute): Properly + release defs of removed stmts, avoid splitting TARGET_MEM_REFs. + 2015-01-13 Chung-Ju Wu * config/nds32/nds32.c (nds32_legitimate_address_p): Consider diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba472c521b6..bd4d1d0bdd5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-01-13 Richard Biener + + PR tree-optimization/64568 + * g++.dg/torture/pr64568.C: New testcase. + 2015-01-12 David Malcolm * jit.dg/test-error-local-used-from-other-function.c: New test diff --git a/gcc/testsuite/g++.dg/torture/pr64568.C b/gcc/testsuite/g++.dg/torture/pr64568.C new file mode 100644 index 00000000000..15a89df449e --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64568.C @@ -0,0 +1,111 @@ +// { dg-do compile } +// { dg-additional-options "-std=c++11" } + +namespace std +{ +typedef long unsigned size_t; +template class complex; +template complex<_Tp> operator+(complex<_Tp>, complex<_Tp>) +{ + complex<_Tp> a = 0; + a += 0; + return a; +} +template <> struct complex +{ + complex (int __i) : _M_value{ __i } {} + int imag (); + void operator+=(complex __z) { _M_value = __z.imag (); } + _Complex double _M_value; +}; +} +class A +{ +public: + A (int); + std::complex &operator[](int i) { return data_[i]; } + std::complex *data_; +}; +struct B +{ + static std::complex + apply (std::complex t1, std::complex t2) + { + return t1 + t2; + } +}; +template struct C +{ + static void + apply (T1 t1, std::complex t2) + { + t1 = t2; + } +}; +template class D +{ +public: + E operator()(); +}; +class G : public D +{ +public: + typedef std::complex value_type; + value_type operator()(int) { return B::apply (0, 0); } +}; +template G operator+(D, D); +template