Patchwork [fortran,5/11] Inline transpose part 1

login
register
mail settings
Submitter Mikael Morin
Date Sept. 4, 2010, 2:26 p.m.
Message ID <4C82570D.6090505@sfr.fr>
Download mbox | patch
Permalink /patch/63785/
State New
Headers show

Comments

Mikael Morin - Sept. 4, 2010, 2:26 p.m.
We can't directly set loop bounds from array bounds as transpose can be 
involved between.
OK for trunk?
2010-09-03  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_set_loop_bounds_from_array_spec): 
	Get the loop dimension from the dim array.

Patch

diff --git a/trans-array.c b/trans-array.c
index d4a0542..da1ae09 100644
--- a/trans-array.c
+++ b/trans-array.c
@@ -555,9 +555,11 @@  gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping * mapping,
   tree tmp;
 
   if (as && as->type == AS_EXPLICIT)
-    for (dim = 0; dim < se->loop->dimen; dim++)
+    for (n = 0; n < se->loop->dimen; n++)
       {
-	n = se->loop->order[dim];
+	dim = se->ss->data.info.dim[n];
+	gcc_assert (dim < as->rank);
+	gcc_assert (se->loop->dimen == as->rank);
 	if (se->loop->to[n] == NULL_TREE)
 	  {
 	    /* Evaluate the lower bound.  */