This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Add testcases for the reassoc issues
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Nov 2013 00:46:15 +0100
- Subject: [committed] Add testcases for the reassoc issues
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've committed a bunch of testcases for the reassoc issues that
were fixed by Easwaran or my r203979 changes, so that we can close those
PRs.
2013-11-28 Jakub Jelinek <jakub@redhat.com>
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.
--- gcc/testsuite/gcc.dg/torture/pr57393-1.c.jj 2013-11-27 15:20:48.436483720 +0100
+++ gcc/testsuite/gcc.dg/torture/pr57393-1.c 2013-11-27 15:19:59.000000000 +0100
@@ -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;
+}
--- gcc/testsuite/gcc.dg/torture/pr57393-2.c.jj 2013-11-27 15:21:00.218405694 +0100
+++ gcc/testsuite/gcc.dg/torture/pr57393-2.c 2013-11-27 15:21:04.166385485 +0100
@@ -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;
+ }
+}
--- gcc/testsuite/gcc.dg/torture/pr57393-3.c.jj 2013-11-27 15:21:17.653316509 +0100
+++ gcc/testsuite/gcc.dg/torture/pr57393-3.c 2013-11-27 15:21:21.927294991 +0100
@@ -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;
+ }
+ }
+}
--- gcc/testsuite/gcc.dg/torture/pr58018.c.jj 2013-11-27 15:21:39.507206174 +0100
+++ gcc/testsuite/gcc.dg/torture/pr58018.c 2013-11-27 15:22:10.480044983 +0100
@@ -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);
+ }
+}
--- gcc/testsuite/gcc.dg/torture/pr58131.c.jj 2013-11-27 15:22:20.839995268 +0100
+++ gcc/testsuite/gcc.dg/torture/pr58131.c 2013-11-27 15:22:33.141930634 +0100
@@ -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;
+ }
+ }
+}
--- gcc/testsuite/gfortran.dg/pr57393-1.f90.jj 2013-11-27 15:23:13.660704919 +0100
+++ gcc/testsuite/gfortran.dg/pr57393-1.f90 2013-11-27 15:18:44.000000000 +0100
@@ -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
--- gcc/testsuite/gfortran.dg/pr57393-2.f90.jj 2013-11-27 15:23:37.148603055 +0100
+++ gcc/testsuite/gfortran.dg/pr57393-2.f90 2013-11-27 15:23:30.000000000 +0100
@@ -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
Jakub