aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2011-11-03 20:46:00 +0000
committerMikael Morin <mikael@gcc.gnu.org>2011-11-03 20:46:00 +0000
commitbee1695c2186d21d30462f1186eea09e9340aacd (patch)
tree15b3eaaa30280e0595884ea396d59a8ccd159c4b /gcc
parent1fb35a9015b37d7404834af022d048fbfddae24e (diff)
downloadgcc-bee1695c2186d21d30462f1186eea09e9340aacd.zip
gcc-bee1695c2186d21d30462f1186eea09e9340aacd.tar.gz
gcc-bee1695c2186d21d30462f1186eea09e9340aacd.tar.bz2
trans-array.c (gfc_trans_preloop_setup): Move code earlier.
* trans-array.c (gfc_trans_preloop_setup): Move code earlier. From-SVN: r180843
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog4
-rw-r--r--gcc/fortran/trans-array.c22
2 files changed, 15 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index cf2222a..fb2123c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,9 @@
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
initialisation earlier. Factor subsequent array references.
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 4b21476..91359e9 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -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
{