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] [03/21] Remove coarray support in the scalarizer: Simplify coarray descriptor setup.


In gfc_conv_expr_descriptor, the code setting the descriptor cobounds (copied
from the non-coarray case) has unnecessary stuff irrelevant to coarrays:
as codimensions can't be transposed, the condition dim[n] == n is guaranteed
to hold true for the codimensions.
This patch removes unnecessary code based on that assumption.

OK?

Attachment: no_coarray_in_scalarizer-3.CL
Description: Text document

diff --git a/trans-array.c b/trans-array.c
index 37cdeb5..88849ef 100644
--- a/trans-array.c
+++ b/trans-array.c
@@ -6140,22 +6140,13 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
 
       for (n = ndim; n < ndim + codim; n++)
 	{
-	  /* look for the corresponding scalarizer dimension: dim.  */
-	  for (dim = 0; dim < ndim + codim; dim++)
-	    if (info->dim[dim] == n)
-	      break;
-
-	  /* loop exited early: the DIM being looked for has been found.  */
-	  gcc_assert (dim < ndim + codim);
-
-	  from = loop.from[dim];
-	  to = loop.to[dim];
+	  from = loop.from[n];
+	  to = loop.to[n];
 	  gfc_conv_descriptor_lbound_set (&loop.pre, parm,
-					  gfc_rank_cst[dim], from);
+					  gfc_rank_cst[n], from);
 	  if (n < ndim + codim - 1)
 	    gfc_conv_descriptor_ubound_set (&loop.pre, parm,
-					    gfc_rank_cst[dim], to);
-	  dim++;
+					    gfc_rank_cst[n], to);
 	}
 
       if (se->data_not_needed)

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