]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-array.c (set_vector_loop_bounds): Loop over the parents.
authorMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 23:28:25 +0000 (23:28 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 23:28:25 +0000 (23:28 +0000)
* trans-array.c (set_vector_loop_bounds): Loop over the parents.

From-SVN: r180892

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c

index 196f3dae126f996a03fa49e36c06487c8b23dd24..47c4938f8e0416f9643b24339558cdc779ce589e 100644 (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.
index 463a0a2cf6f614a935d3bb28599e498526465b3c..25d9a37675c119e5cadc533dbf932fa00db087ab 100644 (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.  */