trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead of array's dimention.

* trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead
	of array's dimention. Check that it is indeed the same.

From-SVN: r180847
This commit is contained in:
Mikael Morin 2011-11-03 20:56:19 +00:00
parent 4f9a70fa31
commit e2b3e6bdd6
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead
of array's dimention. Check that it is indeed the same.
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion.

View File

@ -2861,13 +2861,14 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
if (dim >= info->dimen)
continue;
gcc_assert (info->dimen == loop->dimen);
if (info->ref)
ar = &info->ref->u.ar;
else
ar = NULL;
if (dim == info->dimen - 1)
if (dim == loop->dimen - 1)
i = 0;
else
i = dim + 1;
@ -2876,7 +2877,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
gcc_assert (i == loop->order[i]);
i = loop->order[i];
if (dim == info->dimen - 1)
if (dim == loop->dimen - 1)
{
stride = gfc_conv_array_stride (info->descriptor, info->dim[i]);