From: Richard Biener Date: Fri, 16 Jan 2015 13:21:11 +0000 (+0000) Subject: re PR middle-end/64568 (error: invalid reference prefix) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0399a8db1c67b92d8f46c1b71bae910a773a05e9;p=gcc.git re PR middle-end/64568 (error: invalid reference prefix) 2015-01-16 Richard Biener PR tree-optimization/64568 * tree-ssa-forwprop.c (pass_forwprop::execute): Guard complex load rewriting for TARGET_MEM_REFs. * g++.dg/torture/pr64568-2.C: New testcase. From-SVN: r219736 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4010ace26a6..c9a70702d52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-16 Richard Biener + + PR tree-optimization/64568 + * tree-ssa-forwprop.c (pass_forwprop::execute): Guard + complex load rewriting for TARGET_MEM_REFs. + 2015-01-16 Uros Bizjak * builtins.c (expand_builtin_acc_on_device): Check target for NULL. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6da9eee4d23..81645b11cae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Richard Biener + + PR tree-optimization/64568 + * g++.dg/torture/pr64568-2.C: New testcase. + 2015-01-16 Ilya Enkovich PR target/64363 diff --git a/gcc/testsuite/g++.dg/torture/pr64568-2.C b/gcc/testsuite/g++.dg/torture/pr64568-2.C new file mode 100644 index 00000000000..05782179008 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64568-2.C @@ -0,0 +1,146 @@ +// { dg-do compile } + +namespace std +{ + typedef __SIZE_TYPE__ size_t; +} +class H; +namespace std +{ + template struct complex; + template + complex<_Tp> operator+(complex<_Tp> &__x, complex<_Tp> __y) + { + complex<_Tp> a = __x; + a += __y; + return a; + } + template <> struct complex + { + int + imag () + { + return __imag__ _M_value; + } + void operator+=(complex __z) { _M_value += _M_value; _M_value += __z.imag (); } + _Complex double _M_value; + }; +} +struct A +{ + typedef std::complex &const_reference; +}; +class B +{ +public: + B (int); + std::complex &operator[](int i) { return data_[i]; } + std::complex *data_; +}; +struct C +{ + static std::complex + apply (A::const_reference t1, std::complex t2) + { + return t1 + t2; + } + typedef std::complex result_type; +}; +template struct D +{ + static void + apply (T1 t1, std::complex t2) + { + t1 = t2; + } +}; +class ublas_expression +{ +public: + ~ublas_expression (); +}; +template class F +{ +}; +template class matrix_expression : ublas_expression +{ +public: + E &operator()() {} +}; +class I : public F +{ +public: + typedef int value_type; + I (int); +}; +template matrix_expression outer_prod (F, F); +template class J : public matrix_expression > +{ +public: + typedef typename F::result_type value_type; + value_type operator()(int i, int) + { + return F::apply (e1_ (i, 0), e2_ (0, 0)); + } + E1 e1_; + E1 e2_; +}; +template +J operator+(matrix_expression, matrix_expression); +template