OSDN Git Service

* trans-array.c (gfc_trans_preloop_setup): Factor loop index
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 20:49:14 +0000 (20:49 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 20:49:14 +0000 (20:49 +0000)
initialization.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180844 138bc75d-0d04-0410-961f-82ee72b054a4

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

index fb2123c..9251833 100644 (file)
@@ -1,5 +1,10 @@
 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * trans-array.c (gfc_trans_preloop_setup): Factor loop index
+       initialization.
+
+2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
+
        * trans-array.c (gfc_trans_preloop_setup): Move code earlier.
 
 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
index 91359e9..e3134f5 100644 (file)
@@ -2863,16 +2863,15 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
        continue;
 
       if (info->ref)
-       {
-         ar = &info->ref->u.ar;
-         i = loop->order[dim + 1];
-       }
+       ar = &info->ref->u.ar;
       else
-       {
-         ar = NULL;
-         i = dim + 1;
-       }
+       ar = NULL;
+
+      i = dim + 1;
 
+      /* For the time being, there is no loop reordering.  */
+      gcc_assert (i == loop->order[i]);
+      i = loop->order[i];
 
       if (dim == info->dimen - 1)
        {