From e1b60626151424a379e33339e9531a66adcc3af8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 28 Nov 2013 00:41:56 +0100 Subject: [PATCH] re PR middle-end/57393 (error: definition in block 4 follows the use / internal compiler error: verify_ssa failed) PR middle-end/57393 PR tree-optimization/58018 PR tree-optimization/58131 * gcc.dg/torture/pr57393-1.c: New test. * gcc.dg/torture/pr57393-2.c: New test. * gcc.dg/torture/pr57393-3.c: New test. * gcc.dg/torture/pr58018.c: New test. * gcc.dg/torture/pr58131.c: New test. * gfortran.dg/pr57393-1.f90: New test. * gfortran.dg/pr57393-2.f90: New test. From-SVN: r205466 --- gcc/testsuite/ChangeLog | 13 ++++++++ gcc/testsuite/gcc.dg/torture/pr57393-1.c | 15 ++++++++++ gcc/testsuite/gcc.dg/torture/pr57393-2.c | 16 ++++++++++ gcc/testsuite/gcc.dg/torture/pr57393-3.c | 20 +++++++++++++ gcc/testsuite/gcc.dg/torture/pr58018.c | 22 ++++++++++++++ gcc/testsuite/gcc.dg/torture/pr58131.c | 22 ++++++++++++++ gcc/testsuite/gfortran.dg/pr57393-1.f90 | 38 ++++++++++++++++++++++++ gcc/testsuite/gfortran.dg/pr57393-2.f90 | 10 +++++++ 8 files changed, 156 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr57393-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr57393-2.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr57393-3.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr58018.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr58131.c create mode 100644 gcc/testsuite/gfortran.dg/pr57393-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr57393-2.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cbe6131004b..4cb559c63f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2013-11-28 Jakub Jelinek + + PR middle-end/57393 + PR tree-optimization/58018 + PR tree-optimization/58131 + * gcc.dg/torture/pr57393-1.c: New test. + * gcc.dg/torture/pr57393-2.c: New test. + * gcc.dg/torture/pr57393-3.c: New test. + * gcc.dg/torture/pr58018.c: New test. + * gcc.dg/torture/pr58131.c: New test. + * gfortran.dg/pr57393-1.f90: New test. + * gfortran.dg/pr57393-2.f90: New test. + 2013-11-27 Bill Schmidt * gfortran.dg/nan_7.f90: Disable for little endian PowerPC. diff --git a/gcc/testsuite/gcc.dg/torture/pr57393-1.c b/gcc/testsuite/gcc.dg/torture/pr57393-1.c new file mode 100644 index 00000000000..e62d44df484 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57393-1.c @@ -0,0 +1,15 @@ +/* PR middle-end/57393 */ +/* { dg-do compile } */ +/* { dg-additional-options "-g -ffast-math" } */ + +extern void bar (double); + +struct S { int n; }; + +void +foo (struct S s, double a, int i, int j, int k) +{ + struct S t; + bar (s.n * a * i * j); + t.n = s.n * a * i * k; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr57393-2.c b/gcc/testsuite/gcc.dg/torture/pr57393-2.c new file mode 100644 index 00000000000..b9b12ffa557 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57393-2.c @@ -0,0 +1,16 @@ +/* PR middle-end/57393 */ +/* { dg-do compile } */ + +char a; + +foo (int **p) +{ + int b; + for (;;) + { + int c[1] = { 0 }; + unsigned *d = &c[0]; + for (b = 7; b; b--) + **p &= --*d >= a; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr57393-3.c b/gcc/testsuite/gcc.dg/torture/pr57393-3.c new file mode 100644 index 00000000000..34cece06cbd --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57393-3.c @@ -0,0 +1,20 @@ +/* PR middle-end/57393 */ +/* { dg-do compile } */ + +int a, b, c; +void foo (void); + +int +bar (void) +{ + for (;;) + { + foo (); + int d = a = 0; + for (; a < 7; ++a) + { + d--; + b &= c <= d; + } + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr58018.c b/gcc/testsuite/gcc.dg/torture/pr58018.c new file mode 100644 index 00000000000..52c8e83fa0d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr58018.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/58018 */ +/* { dg-do compile } */ + +int a, b, c, d, e; + +void +bar (int p) +{ + int f = b; + e &= p <= (f ^= 0); +} + +void +foo () +{ + for (; d; d++) + { + bar (a && c); + bar (0); + bar (1); + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr58131.c b/gcc/testsuite/gcc.dg/torture/pr58131.c new file mode 100644 index 00000000000..3f68d4c5286 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr58131.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/58131 */ +/* { dg-do compile } */ + +short a; +int b, c, d[1][4][2]; + +void +foo (void) +{ + int *e; + for (b = 1; ; b--) + { + if (*e) + break; + for (c = 2; c >= 0; c--) + { + *e |= d[0][3][b] != a; + int *f = &d[0][3][b]; + *f = 0; + } + } +} diff --git a/gcc/testsuite/gfortran.dg/pr57393-1.f90 b/gcc/testsuite/gfortran.dg/pr57393-1.f90 new file mode 100644 index 00000000000..6b2cb1b3fe6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr57393-1.f90 @@ -0,0 +1,38 @@ +! PR middle-end/57393 +! { dg-do compile } +! { dg-options "-g -O2 -ffast-math" } + +SUBROUTINE pr57393(nn,e,g,t0,t1,t2,t3,t4,t5,t6,t7,& + t8,t9,t10,t11,t12,t13,t14,t15,& + t16,t17,t18,t19,t20,t21,t22,t23,& + t24,t25,t26,t27,t28,t29,t30,& + t31,t32,t33,t34,t35,t36,t37,t38,& + t39,t40,t41,t42,t43,t44,t45,t46,t47) + IMPLICIT REAL*8 (t) + INTEGER, PARAMETER :: dp=8 + REAL(kind=dp) :: e(nn) + DO ii=1,nn + t48 = 0.1955555555e2_dp * t1 * t2 + & + 0.6000000000e1_dp * t3 * t4 * t5 + t49 = 0.1620000000e3_dp * t6 * t7 * t8 + & + 0.1080000000e3_dp * t6 * t9 * t5 - & + 0.6000000000e1_dp * t10 * t20 * t21 * t55 - & + 0.2400000000e2_dp * t10 * t11 * t12 - & + 0.1200000000e2_dp * t13 * t14 * t15 + t50 = t49 + t16 + t51 = (3 * t17 * t18 * t19) + & + (t22 * t23 * t19) + (t50 * t19) - & + 0.3333333336e0_dp * t24 * t25 + t52 = 0.1555555556e1_dp * t26 * t27 * t12 + & + (t51 + t28 + t29 + t30) * & + 0.3125000000e0_dp * t31 * t32 * t33 * t34 + t53 = -0.1000000001e1_dp * t35 * t36 * t5 - & + (t37 + t38 + t39 + t52) - & + 0.8333333340e-1_dp * t40 * t41 * t42 + t54 = -0.1000000001e1_dp * t43 * t44 * t45 - & + t47 * (t46 + t53) + IF (g >= 3 .OR. g == -3) THEN + e(ii) = e(ii) + t54 * t0 + END IF + END DO +END SUBROUTINE pr57393 diff --git a/gcc/testsuite/gfortran.dg/pr57393-2.f90 b/gcc/testsuite/gfortran.dg/pr57393-2.f90 new file mode 100644 index 00000000000..fafa8f900f1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr57393-2.f90 @@ -0,0 +1,10 @@ +! PR middle-end/57393 +! { dg-do compile } +! { dg-options "-g -O2" } + +SUBROUTINE pr57393 ( a1, a2, a3, a4, a5, a6, a7 ) + COMPLEX(kind=8), DIMENSION(:), INTENT(IN) :: a1 + INTEGER, DIMENSION(:), INTENT(IN) :: a2, a3, a5, a6 + COMPLEX(kind=8), DIMENSION(:), INTENT(INOUT) :: a4 + a4(a6(1)+1:a6(1)+a5(1))=a1(a3(1)+1:a3(1)+a2(1)) +END SUBROUTINE pr57393