From 4f9a70fa3101a0f44fe1d49af24764b7c540da00 Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Thu, 3 Nov 2011 20:52:14 +0000 Subject: [PATCH] trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion. * trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion. Special case outermost loop. From-SVN: r180846 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-array.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9251833..7c36e10 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2011-11-03 Mikael Morin + * trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion. + Special case outermost loop. + +2011-11-03 Mikael Morin + * trans-array.c (gfc_trans_preloop_setup): Factor loop index initialization. diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index e3134f5..f5e30ae 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -2867,7 +2867,10 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, else ar = NULL; - i = dim + 1; + if (dim == info->dimen - 1) + i = 0; + else + i = dim + 1; /* For the time being, there is no loop reordering. */ gcc_assert (i == loop->order[i]); @@ -2875,10 +2878,6 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, if (dim == info->dimen - 1) { - i = loop->order[0]; - /* For the time being, the innermost loop is unconditionally on - the first dimension of the scalarization loop. */ - gcc_assert (i == 0); stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); /* Calculate the stride of the innermost loop. Hopefully this will -- 2.7.4