From 8f77aa9086f8172d87abf955a95bfbfb87440a26 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Mon, 22 Jun 2015 13:16:04 +0000 Subject: [PATCH] re PR target/65914 (error: unrecognizable insn) [gcc] 2015-06-22 Bill Schmidt PR target/65914 * config/rs6000/predicates.md (altivec_register_operand): Permit virtual stack registers. (vsx_register_operand): Likewise. (vfloat_operand): Likewise. (vint_operand): Likewise. (vlogical_operand): Likewise. [gcc/testsuite] 2015-06-22 Bill Schmidt PR target/65914 * g++.dg/torture/pr65914.C: New. From-SVN: r224725 --- gcc/ChangeLog | 10 ++++ gcc/config/rs6000/predicates.md | 10 ++-- gcc/testsuite/ChangeLog | 5 ++ gcc/testsuite/g++.dg/torture/pr65914.C | 70 ++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr65914.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9dc3b9159e4..9bfaa22f49b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-06-22 Bill Schmidt + + PR target/65914 + * config/rs6000/predicates.md (altivec_register_operand): Permit + virtual stack registers. + (vsx_register_operand): Likewise. + (vfloat_operand): Likewise. + (vint_operand): Likewise. + (vlogical_operand): Likewise. + 2015-06-22 Richard Biener * tree-vectorizer.h (_loop_vec_info): Add scalar_cost_vec diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index fd293ab4f6e..e2d836f68a2 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -41,7 +41,7 @@ if (!REG_P (op)) return 0; - if (REGNO (op) > LAST_VIRTUAL_REGISTER) + if (REGNO (op) >= FIRST_PSEUDO_REGISTER) return 1; return ALTIVEC_REGNO_P (REGNO (op)); @@ -57,7 +57,7 @@ if (!REG_P (op)) return 0; - if (REGNO (op) > LAST_VIRTUAL_REGISTER) + if (REGNO (op) >= FIRST_PSEUDO_REGISTER) return 1; return VSX_REGNO_P (REGNO (op)); @@ -74,7 +74,7 @@ if (!REG_P (op)) return 0; - if (REGNO (op) > LAST_VIRTUAL_REGISTER) + if (REGNO (op) >= FIRST_PSEUDO_REGISTER) return 1; return VFLOAT_REGNO_P (REGNO (op)); @@ -91,7 +91,7 @@ if (!REG_P (op)) return 0; - if (REGNO (op) > LAST_VIRTUAL_REGISTER) + if (REGNO (op) >= FIRST_PSEUDO_REGISTER) return 1; return VINT_REGNO_P (REGNO (op)); @@ -108,7 +108,7 @@ if (!REG_P (op)) return 0; - if (REGNO (op) > LAST_VIRTUAL_REGISTER) + if (REGNO (op) >= FIRST_PSEUDO_REGISTER) return 1; return VLOGICAL_REGNO_P (REGNO (op)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 06ab4972690..faa73a5dccf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-22 Bill Schmidt + + PR target/65914 + * g++.dg/torture/pr65914.C: New. + 2015-06-22 Richard Biener * lib/c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on diff --git a/gcc/testsuite/g++.dg/torture/pr65914.C b/gcc/testsuite/g++.dg/torture/pr65914.C new file mode 100644 index 00000000000..fada262b5b1 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr65914.C @@ -0,0 +1,70 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-std=c++14" } */ + +enum expression_template_option { et_on }; +template class A; +template struct expression; +template struct B { typedef const T &type; }; +template +struct B> { + typedef expression type; +}; +template +struct expression { + expression(Arg1 p1, const Arg2 &p2) : arg1(p1), arg2(p2) {} + typename B::type arg1; + typename B::type arg2; +}; +template expression> sin(A) { + return expression>(0, 0); +} +template +expression> + asin(expression p1) { + return expression>(0, p1); +} +template +expression, expression> + operator+(A, expression p2) { + return expression, expression>(0, p2); +} +template +expression, expression> + operator*(expression p1, + expression p2) { + return expression, + expression>(p1, p2); +} +template expression, A> operator/(A, A) { + return expression, A>(0, 0); +} +template +void operator/(expression, V); +template class A { +public: + A() {} + template A(V) {} +}; +template void jacobi_recurse(T, T, Policy) { + T a, b, c; + (a+asin(b/c) * sin(a)) / 0.1; +} +template void jacobi_imp(T p1, Policy) { + T x; + jacobi_recurse(x, p1, 0); +} +template +void jacobi_elliptic(T, U, V, Policy) { + jacobi_imp(static_cast(0), 0); +} +template void jacobi_sn(U, T, Policy) { + jacobi_elliptic(static_cast(0), 0, 0, 0); +} +template void jacobi_sn(U, T p2) { jacobi_sn(0, p2, 0); } +template void test_extra(T) { + T d; + jacobi_sn(0, d); +} +void foo() { test_extra(A()); } -- 2.30.2