]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-array.c (gfc_trans_preloop_setup): Move code earlier.
authorMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 20:46:00 +0000 (20:46 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 20:46:00 +0000 (20:46 +0000)
* trans-array.c (gfc_trans_preloop_setup): Move code earlier.

From-SVN: r180843

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

index cf2222a7a364f4e09d912449381d5f7586da767e..fb2123c255857ec7defe2fd183e2f2f56d181855 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        * trans-array.c (gfc_trans_preloop_setup): Move array reference
index 4b21476d7d5a14321a37d16cada65aa94359c438..91359e9c57ec922bde8d7984154267f523d66ef5 100644 (file)
@@ -2876,6 +2876,17 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
 
       if (dim == info->dimen - 1)
        {
+         i = loop->order[0];
+         /* For the time being, the innermost loop is unconditionally on
+            the first dimension of the scalarization loop.  */
+         gcc_assert (i == 0);
+         stride = gfc_conv_array_stride (info->descriptor, info->dim[i]);
+
+         /* Calculate the stride of the innermost loop.  Hopefully this will
+            allow the backend optimizers to do their stuff more effectively.
+          */
+         info->stride0 = gfc_evaluate_now (stride, pblock);
+
          /* For the outermost loop calculate the offset due to any
             elemental dimensions.  It will have been initialized with the
             base offset of the array.  */
@@ -2900,17 +2911,6 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
                  info->offset = gfc_evaluate_now (info->offset, pblock);
                }
            }
-
-         i = loop->order[0];
-         /* For the time being, the innermost loop is unconditionally on
-            the first dimension of the scalarization loop.  */
-         gcc_assert (i == 0);
-         stride = gfc_conv_array_stride (info->descriptor, info->dim[i]);
-
-         /* Calculate the stride of the innermost loop.  Hopefully this will
-            allow the backend optimizers to do their stuff more effectively.
-          */
-         info->stride0 = gfc_evaluate_now (stride, pblock);
        }
       else
        {