From 633343a8594fb64dd9ffa7edc9191e1942cf23e3 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 1 Jun 2015 13:58:50 +0000 Subject: [PATCH] re PR tree-optimization/66349 (ICE on valid code at -O1, -O2 and -O3 on x86_64-linux-gnu in dfs_enumerate_from, at cfganal.c:1195) 2015-06-01 Richard Biener 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 | 9 ++++++ gcc/testsuite/gcc.dg/torture/pr66349.c | 31 +++++++++++++++++++ gcc/testsuite/gcc.dg/torture/pr66357.c | 26 ++++++++++++++++ .../compile/pr66352.f90 | 18 +++++++++++ 4 files changed, 84 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr66349.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr66357.c create mode 100644 gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2de41e59ba2..70d2f1afcd5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2015-06-01 Richard Biener + + 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 Revert diff --git a/gcc/testsuite/gcc.dg/torture/pr66349.c b/gcc/testsuite/gcc.dg/torture/pr66349.c new file mode 100644 index 00000000000..8aa8c56beff --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66349.c @@ -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 index 00000000000..4e574f9de53 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66357.c @@ -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 index 00000000000..7d3c74acd96 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr66352.f90 @@ -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 -- 2.30.2