Commit 065c6f9d by Mikael Morin Committed by Mikael Morin

trans-array.c (gfc_conv_section_startstride): Remove coarray argument.

	* trans-array.c (gfc_conv_section_startstride): Remove coarray argument.
	Remove conditions on coarray.
	(gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
	(gfc_conv_expr_descriptor): Ditto. Add assertions before the call.

From-SVN: r179693
parent 6cb0246c
2011-10-07 Mikael Morin <mikael.morin@sfr.fr> 2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_section_startstride): Remove coarray argument.
Remove conditions on coarray.
(gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
(gfc_conv_expr_descriptor): Ditto. Add assertions before the call.
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_section_startstride): Remove coarray_last * trans-array.c (gfc_conv_section_startstride): Remove coarray_last
argument. Remove condition on coarray_last. argument. Remove condition on coarray_last.
(gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride. (gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
......
...@@ -3200,8 +3200,7 @@ evaluate_bound (stmtblock_t *block, tree *bounds, gfc_expr ** values, ...@@ -3200,8 +3200,7 @@ evaluate_bound (stmtblock_t *block, tree *bounds, gfc_expr ** values,
/* Calculate the lower bound of an array section. */ /* Calculate the lower bound of an array section. */
static void static void
gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim, gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
bool coarray)
{ {
gfc_expr *stride = NULL; gfc_expr *stride = NULL;
tree desc; tree desc;
...@@ -3219,16 +3218,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim, ...@@ -3219,16 +3218,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
/* We use a zero-based index to access the vector. */ /* We use a zero-based index to access the vector. */
info->start[dim] = gfc_index_zero_node; info->start[dim] = gfc_index_zero_node;
info->end[dim] = NULL; info->end[dim] = NULL;
if (!coarray) info->stride[dim] = gfc_index_one_node;
info->stride[dim] = gfc_index_one_node;
return; return;
} }
gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE
|| ar->dimen_type[dim] == DIMEN_THIS_IMAGE); || ar->dimen_type[dim] == DIMEN_THIS_IMAGE);
desc = info->descriptor; desc = info->descriptor;
if (!coarray) stride = ar->stride[dim];
stride = ar->stride[dim];
/* Calculate the start of the range. For vector subscripts this will /* Calculate the start of the range. For vector subscripts this will
be the range of the vector. */ be the range of the vector. */
...@@ -3240,9 +3237,9 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim, ...@@ -3240,9 +3237,9 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
evaluate_bound (&loop->pre, info->end, ar->end, desc, dim, false); evaluate_bound (&loop->pre, info->end, ar->end, desc, dim, false);
/* Calculate the stride. */ /* Calculate the stride. */
if (!coarray && stride == NULL) if (stride == NULL)
info->stride[dim] = gfc_index_one_node; info->stride[dim] = gfc_index_one_node;
else if (!coarray) else
{ {
gfc_init_se (&se, NULL); gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, stride, gfc_array_index_type); gfc_conv_expr_type (&se, stride, gfc_array_index_type);
...@@ -3319,8 +3316,7 @@ done: ...@@ -3319,8 +3316,7 @@ done:
gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter); gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter);
for (n = 0; n < ss->data.info.dimen; n++) for (n = 0; n < ss->data.info.dimen; n++)
gfc_conv_section_startstride (loop, ss, ss->data.info.dim[n], gfc_conv_section_startstride (loop, ss, ss->data.info.dim[n]);
false);
break; break;
case GFC_SS_INTRINSIC: case GFC_SS_INTRINSIC:
...@@ -5975,7 +5971,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -5975,7 +5971,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
for (n = ss->data.info.dimen; n < ss->data.info.dimen + codim - 1; for (n = ss->data.info.dimen; n < ss->data.info.dimen + codim - 1;
n++) n++)
{ {
gfc_conv_section_startstride (&loop, ss, n, true); /* Make sure we are not lost somehow. */
gcc_assert (info->ref->u.ar.dimen_type[n] == DIMEN_THIS_IMAGE);
/* Make sure the call to gfc_conv_section_startstride won't
generate unnecessary code to calculate stride. */
gcc_assert (info->ref->u.ar.stride[n] == NULL);
gfc_conv_section_startstride (&loop, ss, n);
loop.from[n] = info->start[n]; loop.from[n] = info->start[n];
loop.to[n] = info->end[n]; loop.to[n] = info->end[n];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment