diff mbox

[fortran,40..43/66] inline sum and product: Update the scalarizer: New gfc_ss::parent field.

Message ID 20111027233220.18581.6976@gimli.local
State New
Headers show

Commit Message

Mikael Morin Oct. 27, 2011, 11:32 p.m. UTC
We are going to loop over the parent array infos.
This introduces a new parent field to permit this loop (patch 40).
Then it will be used to loop over multiple parent ss:
 - gfc_set_loop_bounds_from_array_spec (patch 41 with context diff)
 - gfc_trans_array_constructor (patch 42)
 - set_vector_loop_bounds (patch 43)
OK?
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans.h (struct gfc_ss): New field parent.
	* trans-array.c (gfc_trans_scalarizing_loops): Skip clearing if a
	parent exists.
	* trans-expr.c (gfc_advance_se_ss_chain): Move to parent ss at the
	end of the chain.
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_set_loop_bounds_from_array_spec): Loop over the
	parents.
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_trans_array_constructor): Loop over the parents.
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_set_vector_loop_bounds): Loop over the parents.
diff mbox

Patch

diff --git a/trans-array.c b/trans-array.c
index 463a0a2..25d9a37 100644
--- a/trans-array.c
+++ b/trans-array.c
@@ -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.  */