Commit 3ca39858 by Mikael Morin Committed by Mikael Morin

trans-array.c (gfc_conv_section_startstride): Factor common array ref references.

	* trans-array.c (gfc_conv_section_startstride): Factor common
	array ref references.

From-SVN: r179679
parent a7525708
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): Factor common
array ref references.
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_expr_descriptor): Use codim instead of * trans-array.c (gfc_conv_expr_descriptor): Use codim instead of
loop.codimen as argument to gfc_get_array_type_bounds. loop.codimen as argument to gfc_get_array_type_bounds.
......
...@@ -3187,12 +3187,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim, ...@@ -3187,12 +3187,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
tree desc; tree desc;
gfc_se se; gfc_se se;
gfc_ss_info *info; gfc_ss_info *info;
gfc_array_ref *ar;
gcc_assert (ss->type == GFC_SS_SECTION); gcc_assert (ss->type == GFC_SS_SECTION);
info = &ss->data.info; info = &ss->data.info;
ar = &info->ref->u.ar;
if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR) if (ar->dimen_type[dim] == DIMEN_VECTOR)
{ {
/* 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;
...@@ -3202,12 +3204,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim, ...@@ -3202,12 +3204,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
return; return;
} }
gcc_assert (info->ref->u.ar.dimen_type[dim] == DIMEN_RANGE); gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE);
desc = info->descriptor; desc = info->descriptor;
start = info->ref->u.ar.start[dim]; start = ar->start[dim];
end = info->ref->u.ar.end[dim]; end = ar->end[dim];
if (!coarray) if (!coarray)
stride = info->ref->u.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. */
......
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