trans-array.c (set_vector_loop_bounds): Loop over the parents.

* trans-array.c (set_vector_loop_bounds): Loop over the parents.

From-SVN: r180892
This commit is contained in:
Mikael Morin 2011-11-03 23:28:25 +00:00
parent fa168d9ff4
commit f49afcb009
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (set_vector_loop_bounds): Loop over the parents.
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_array_constructor): Loop over the parents.

View File

@ -2197,14 +2197,18 @@ set_vector_loop_bounds (gfc_ss * ss)
int dim;
info = &ss->info->data.array;
loop = ss->loop;
for (n = 0; n < loop->dimen; n++)
for (; ss; ss = ss->parent)
{
dim = ss->dim[n];
if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR
&& loop->to[n] == NULL)
loop = ss->loop;
for (n = 0; n < loop->dimen; n++)
{
dim = ss->dim[n];
if (info->ref->u.ar.dimen_type[dim] != DIMEN_VECTOR
|| loop->to[n] != NULL)
continue;
/* Loop variable N indexes vector dimension DIM, and we don't
yet know the upper bound of loop variable N. Set it to the
difference between the vector's upper and lower bounds. */