2015-06-01  Richard Biener  <rguent...@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.

Index: gcc/testsuite/gcc.dg/torture/pr66357.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr66357.c      (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr66357.c      (working copy)
***************
*** 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;
+           }
+       }
+ }
Index: gcc/testsuite/gcc.dg/torture/pr66349.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr66349.c      (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr66349.c      (working copy)
***************
*** 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;
+       }
+     }
+ }
Index: gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90
===================================================================
*** gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90  (revision 0)
--- gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90  (working copy)
***************
*** 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

Reply via email to