]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-array.c (gfc_conv_loop_setup, [...]): Move specloop arrays clearing from the...
authorMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 22:42:58 +0000 (22:42 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Thu, 3 Nov 2011 22:42:58 +0000 (22:42 +0000)
* 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

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

index 0d0e730b9cba918369452fd531cae965fdb43b9f..af37e211ca0a7f2334dd98a377b955c9629c327e 100644 (file)
@@ -1,3 +1,8 @@
+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
index 302f937989cdd2d95696dc414d7889dc723db14e..545f2fb21a90c09ee439ae3f56656317b18eeb0a 100644 (file)
@@ -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)