diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2008-05-21 23:13:00 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2008-05-21 23:13:00 +0000 |
commit | 4e8d71770098bd2fc4ddf78c68fa72a2df205308 (patch) | |
tree | d94b5ef5e17a03628d716a1445a4b91366182b82 /gcc | |
parent | 5d6342ebc23344e8168b1589589b68f7b6781f66 (diff) | |
download | gcc-4e8d71770098bd2fc4ddf78c68fa72a2df205308.zip gcc-4e8d71770098bd2fc4ddf78c68fa72a2df205308.tar.gz gcc-4e8d71770098bd2fc4ddf78c68fa72a2df205308.tar.bz2 |
re PR middle-end/36286 (ICE with -ftree-loop-linear and -O1 and above)
2008-05-21 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/36286
PR tree-optimization/36287
* lambda-code.c (build_access_matrix): Do not use the loop->num
for computing the number of induction variables: use the loop depth
instead.
* testsuite/gcc.dg/tree-ssa/pr36287.c: New.
* testsuite/gfortran.dg/pr36286.f90: New.
From-SVN: r135741
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/lambda-code.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr36287.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr36286.f90 | 14 |
5 files changed, 54 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b71520e..1bf285e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2008-05-21 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/36287 + PR tree-optimization/36286 + * lambda-code.c (build_access_matrix): Do not use the loop->num + for computing the number of induction variables: use the loop depth + instead. + 2008-05-21 Kai Tietz <kai.tietz@onevision.com> PR/36280 diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 7075911..5ae74ff 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -2794,12 +2794,13 @@ build_access_matrix (data_reference_p data_reference, struct access_matrix *am = GGC_NEW (struct access_matrix); unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference); struct loop *loop = bb_for_stmt (DR_STMT (data_reference))->loop_father; - unsigned nb_induction_vars = loop_depth (loop) - loop_nest_num + 1; + struct loop *loop_nest = get_loop (loop_nest_num); + unsigned nivs = loop_depth (loop) - loop_depth (loop_nest) + 1; unsigned lambda_nb_columns; lambda_vector_vec_p matrix; AM_LOOP_NEST_NUM (am) = loop_nest_num; - AM_NB_INDUCTION_VARS (am) = nb_induction_vars; + AM_NB_INDUCTION_VARS (am) = nivs; AM_PARAMETERS (am) = parameters; lambda_nb_columns = AM_NB_COLUMNS (am); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3a88c77..9a033ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2008-05-21 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/36287 + PR tree-optimization/36286 + * gcc.dg/tree-ssa/pr36287.c: New. + * gfortran.dg/pr36286.f90: New. + 2008-05-21 Tom Tromey <tromey@redhat.com> PR preprocessor/27777: diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr36287.c b/gcc/testsuite/gcc.dg/tree-ssa/pr36287.c new file mode 100644 index 0000000..51b77c7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr36287.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-loop-linear" } */ + +int tab[2][2]; + +int foo () +{ + int i, j, k; + + for (i = 0; i < 2; ++i) + for (j = 0; j < 2; ++j) + for (k = 0; k < 2; ++k) + {} + + for (i = 0; i < 2; ++i) + for (j = 0; j < 2; ++j) + if (i == 0) + tab[i][j] = 0; + + return tab[0][1]; +} + diff --git a/gcc/testsuite/gfortran.dg/pr36286.f90 b/gcc/testsuite/gfortran.dg/pr36286.f90 new file mode 100644 index 0000000..bcdef08 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr36286.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! { dg-options "-O1 -ftree-loop-linear" } +! PR tree-optimization/36286 + +program test_count + integer, dimension(2,3) :: a, b + a = reshape( (/ 1, 3, 5, 2, 4, 6 /), (/ 2, 3 /)) + b = reshape( (/ 0, 3, 5, 7, 4, 8 /), (/ 2, 3 /)) + print '(3l6)', a.ne.b + print *, a(1,:).ne.b(1,:) + print *, a(2,:).ne.b(2,:) + print *, count(a.ne.b) +end program test_count + |