Commit a04b23d8 by Mikael Morin

re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents)

	PR fortran/50420
	* trans-array.c (gfc_conv_expr_descriptor): Count codimensions starting
	from zero, and add then the relevant offset (either ndim or loop.dimen)
	depending on context.

From-SVN: r180142
parent 7c5950bd
2011-10-18 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/50420
* trans-array.c (gfc_conv_expr_descriptor): Count codimensions starting
from zero, and add then the relevant offset (either ndim or loop.dimen)
depending on context.
2011-10-18 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_conv_expr_descriptor): Save some horizontal space.
2011-10-18 Mikael Morin <mikael@gcc.gnu.org>
......
......@@ -5981,25 +5981,24 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
gfc_array_ref *ar = &info->ref->u.ar;
codim = gfc_get_corank (expr);
for (n = ss->data.info.dimen; n < ss->data.info.dimen + codim - 1;
n++)
for (n = 0; n < codim - 1; n++)
{
/* Make sure we are not lost somehow. */
gcc_assert (ar->dimen_type[n] == DIMEN_THIS_IMAGE);
gcc_assert (ar->dimen_type[n + ndim] == DIMEN_THIS_IMAGE);
/* Make sure the call to gfc_conv_section_startstride won't
generate unnecessary code to calculate stride. */
gcc_assert (ar->stride[n] == NULL);
gcc_assert (ar->stride[n + ndim] == NULL);
gfc_conv_section_startstride (&loop, ss, n);
loop.from[n] = info->start[n];
loop.to[n] = info->end[n];
gfc_conv_section_startstride (&loop, ss, n + ndim);
loop.from[n + loop.dimen] = info->start[n + ndim];
loop.to[n + loop.dimen] = info->end[n + ndim];
}
gcc_assert (n == ss->data.info.dimen + codim - 1);
gcc_assert (n == codim - 1);
evaluate_bound (&loop.pre, info->start, ar->start,
info->descriptor, n, true);
loop.from[n] = info->start[n];
info->descriptor, n + ndim, true);
loop.from[n + loop.dimen] = info->start[n + ndim];
}
else
codim = 0;
......
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