aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2011-11-03 22:42:58 +0000
committerMikael Morin <mikael@gcc.gnu.org>2011-11-03 22:42:58 +0000
commitb2028d0b943dff90a98b9c095298ea6413238a88 (patch)
treeec4394047a34554df1efe9916d7a21a46692b43e
parent1d9370e9096e97e380a593039e755523345e530d (diff)
downloadgcc-b2028d0b943dff90a98b9c095298ea6413238a88.zip
gcc-b2028d0b943dff90a98b9c095298ea6413238a88.tar.gz
gcc-b2028d0b943dff90a98b9c095298ea6413238a88.tar.bz2
trans-array.c (gfc_conv_loop_setup, [...]): Move specloop arrays clearing from the former to the latter.
* trans-array.c (gfc_conv_loop_setup, gfc_trans_create_temp_array): Move specloop arrays clearing from the former to the latter. From-SVN: r180881
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-array.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0d0e730..af37e21 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,10 @@
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+ * trans-array.c (gfc_conv_loop_setup, gfc_trans_create_temp_array):
+ Move specloop arrays clearing from the former to the latter.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
* trans-array.c (set_loop_bounds): Separate the beginning of
gfc_conv_loop_setup into a function of its own.
(set_delta): Separate the end of gfc_conv_loop_setup into a function
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 302f937..545f2fb 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -902,6 +902,11 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
pre);
loop->from[n] = gfc_index_zero_node;
+ /* We have just changed the loop bounds, we must clear the
+ corresponding specloop, so that delta calculation is not skipped
+ later in set_delta. */
+ loop->specloop[n] = NULL;
+
/* We are constructing the temporary's descriptor based on the loop
dimensions. As the dimensions may be accessed in arbitrary order
(think of transpose) the size taken from the n'th loop may not map
@@ -4136,7 +4141,6 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
{
gfc_ss *tmp_ss;
tree tmp;
- int n;
set_loop_bounds (loop);
@@ -4172,9 +4176,6 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
false, true, false, where);
}
- for (n = 0; n < loop->temp_dim; n++)
- loop->specloop[loop->order[n]] = NULL;
-
/* For array parameters we don't have loop variables, so don't calculate the
translations. */
if (loop->array_parameter)