This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] [32/66] inline sum and product: Update the scalarizer: clear specloop in gfc_trans_create_temp_arrays.


The code clearing specloop in gfc_conv_loop_setup would need some explanation.
This patch moves it to gfc_trans_create_temp_array (where the reason for
it are more clear) with a proper comment.
OK?

Attachment: pr43829-32.CL
Description: Text document

diff --git a/trans-array.c b/trans-array.c
index 302f937..545f2fb 100644
--- a/trans-array.c
+++ b/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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]