From: Richard Biener Date: Tue, 24 May 2016 14:35:36 +0000 (+0000) Subject: re PR tree-optimization/71230 (ICE : in zero_one_operation, at tree-ssa-reassoc.c... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5328f5dc2bc46eedf1d367de0bd751d43f1311d;p=gcc.git re PR tree-optimization/71230 (ICE : in zero_one_operation, at tree-ssa-reassoc.c:1230) 2016-05-24 Richard Biener PR tree-optimization/71230 * tree-ssa-reassoc.c (zero_one_operation): Handle negate special ops. * gcc.dg/torture/pr71230.c: New testcase. * g++.dg/torture/pr71230.C: Likewise. From-SVN: r236643 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eac48e6e8e..13134d91114 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-24 Richard Biener + + PR tree-optimization/71230 + * tree-ssa-reassoc.c (zero_one_operation): Handle negate special ops. + 2016-05-24 Richard Sandiford * tree-vectorizer.h (vectorizable_comparison): Delete. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 361fbbdedba..a6f65b87a19 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-05-24 Richard Biener + + PR tree-optimization/71230 + * gcc.dg/torture/pr71230.c: New testcase. + * g++.dg/torture/pr71230.C: Likewise. + 2016-05-24 Thomas Schwinge * c-c++-common/goacc/routine-5.c: Add tests. diff --git a/gcc/testsuite/g++.dg/torture/pr71230.C b/gcc/testsuite/g++.dg/torture/pr71230.C new file mode 100644 index 00000000000..40ce55a6acc --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr71230.C @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-additional-options "-ffast-math" } + +template class Tensor; +template class Point { +public: + Point (const double x, const double y, const double z); + double operator () (const unsigned int index) const; +}; +template class TriaObjectAccessor { + Point & vertex (const unsigned int i) const; + Point barycenter (double, double, double, double, double) const; +}; +template <> Point<3> TriaObjectAccessor<3, 3>::barycenter (double s6, double s7, double s1, double s2, double s3) const +{ + const double x[8] = { + vertex(0)(0), vertex(1)(0), vertex(2)(0), vertex(3)(0), vertex(4)(0), vertex(5)(0), vertex(6)(0), vertex(7)(0) }; + const double y[8] = { + vertex(0)(1), vertex(1)(1), vertex(2)(1), vertex(3)(1), vertex(4)(1), vertex(5)(1), vertex(6)(1), vertex(7)(1) }; + const double z[8] = { + vertex(0)(2), vertex(1)(2), vertex(2)(2), vertex(3)(2), vertex(4)(2), vertex(5)(2), vertex(6)(2), vertex(7)(2) }; + double s4, s5, s8; + const double unknown0 = s1*s2; + const double unknown1 = s1*s2; + s8 = -z[2]*x[1]*y[2]*z[5]+z[2]*y[1]*x[2]*z[5]-z[2]*z[1]*x[2]*y[5]+z[2]*z [1]*x[5]*y[2]+2.0*y[5]*x[7]*z[4]*z[4]-y[1]*x[2]*z[0]*z[0]+x[0]*y[3]*z[7]*z[7] -2.0*z[5]*z[5]*x[4]*y[1]+2.0*z[5]*z[5]*x[1]*y[4]+z[5]*z[5]*x[0]*y[4]-2.0*z[2]*z [2]*x[1]*y[3]+2.0*z[2]*z[2]*x[3]*y[1]-x[0]*y[4]*z[7]*z[7]-y[0]*x[3]*z[7]*z[7]+x [1]*y[0]*z[5]*z[5]; + s5 = s8+z[2]*x[6]*y[2]*z[5]-z[2]*x[5]*y[2]*z[6]-z[2]*x[2]*y[3]*z[7]-x[2]* y[3]*z[7]*z[7]+2.0*z[2]*x[2]*y[3]*z[1]-z[2]*y[2]*x[3]*z[0]+z[2]*y[2]*x[0]*z[3]- z[2]*x[2]*y[0]*z[3]-z[7]*y[2]*x[7]*z[3]+z[7]*z[2]*x[7]*y[3]+z[7]*x[2]*y[7]*z[3] +z[6]*y[1]*x[2]*z[5]-z[6]*x[1]*y[2]*z[5]+z[5]*x[1]*y[5]*z[2]+s6+s7; + s4 = 1/s5; + s2 = s3*s4; + const double unknown2 = s1*s2; + return Point<3> (unknown0, unknown1, unknown2); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr71230.c b/gcc/testsuite/gcc.dg/torture/pr71230.c new file mode 100644 index 00000000000..d0df8da9b33 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71230.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ffast-math" } */ + +void metric_carttosphere(int *cctk_lsh, double txz, double tyz, double txx, + double tzz, double sint, double cosp, double cost, + double tyy, double sinp, double txy, double *grp, + double *grq, double *r) +{ + int i; + for(i=0; i