re PR tree-optimization/66349 (ICE on valid code at -O1, -O2 and -O3 on x86_64-linux...
authorRichard Biener <rguenther@suse.de>
Mon, 1 Jun 2015 13:58:50 +0000 (13:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 1 Jun 2015 13:58:50 +0000 (13:58 +0000)
2015-06-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/66349
PR tree-optimization/66352
PR tree-optimization/66357
* gcc.dg/torture/pr66357.c: New testcase.
* gcc.dg/torture/pr66349.c: Likewise.
* gfortran.fortran-torture/compile/pr66352.f90: Likewise.

From-SVN: r223980

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr66349.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr66357.c [new file with mode: 0644]
gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90 [new file with mode: 0644]

index 2de41e59ba26eaadf869790427a20eeebc923234..70d2f1afcd552e393323d7e5a49f31492c8a587a 100644 (file)
@@ -1,3 +1,12 @@
+2015-06-01  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66349
+       PR tree-optimization/66352
+       PR tree-optimization/66357
+       * gcc.dg/torture/pr66357.c: New testcase.
+       * gcc.dg/torture/pr66349.c: Likewise.
+       * gfortran.fortran-torture/compile/pr66352.f90: Likewise.
+
 2015-06-01  Richard Biener  <rguenther@suse.de>
 
        Revert
diff --git a/gcc/testsuite/gcc.dg/torture/pr66349.c b/gcc/testsuite/gcc.dg/torture/pr66349.c
new file mode 100644 (file)
index 0000000..8aa8c56
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+
+unsigned int a;
+int b, c, d, e, f;
+
+void
+fn1 ()
+{
+  for (; b; b++)
+    {
+      for (e = 0; e < 1; e++)
+       ;
+      int i = -1, j = 1;
+      if (f)
+       {
+         for (; a < 1; a++)
+           ;
+         i++;
+         j = 0;
+       }
+      for (; d; d++)
+       {
+         if (j)
+           for (;; c++)
+             ;
+         if (i)
+           continue;
+         return;
+       }
+    }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr66357.c b/gcc/testsuite/gcc.dg/torture/pr66357.c
new file mode 100644 (file)
index 0000000..4e574f9
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+int a, c, e, f;
+volatile int d;
+
+void
+fn1 ()
+{
+  if (!e)
+    for (; a; a++)
+      {
+       if (e)
+         for (d++; d;)
+           ;
+       else
+         for (c = 0; c; --c)
+           ;
+       if (f)
+         for (;;)
+           {
+             if (e)
+               break;
+             a = 0;
+           }
+      }
+}
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90
new file mode 100644 (file)
index 0000000..7d3c74a
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-additional-options "-fprofile-generate" }
+  SUBROUTINE matmul_test ( ntim,len)
+    INTEGER, PARAMETER :: dp=8
+    REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: ma, mb, mc
+    INTEGER :: siz,len, ntim
+    DO i = 5, siz, 2
+       len = 2**i + 1
+       ALLOCATE ( ma ( len, len ), STAT = ierr )
+       IF ( ierr /= 0 ) EXIT
+       ALLOCATE ( mb ( len, len ), STAT = ierr )
+       IF ( ierr /= 0 ) EXIT
+       ALLOCATE ( mc ( len, len ), STAT = ierr )
+       IF ( ierr /= 0 ) EXIT
+       DO j = 1, ntim
+          mc = MATMUL ( ma, mb )
+       END DO
+    END DO
+  END SUBROUTINE matmul_test