This patch sets cobounds in a coarray's gfc_ss struct without relying on the
scalarizer doing it automatically.
The convention to have the bounds and cobounds stored in the loop::from
and loop::to arrays while calling gfc_get_array_type_bounds is not changed,
so we need to set the loop.from[n] and loop.to[n] "by hand".
OK?
2011-09-14 Mikael Morin <[email protected]>
* trans-array.c (gfc_conv_expr_descriptor): Add out-of-the-scalarizer
cobounds evaluation.
diff --git a/trans-array.c b/trans-array.c
index 067fe0b..b132bf6 100644
--- a/trans-array.c
+++ b/trans-array.c
@@ -5994,7 +5994,21 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
tree base;
if (se->want_coarray)
- codim = gfc_get_corank (expr);
+ {
+ codim = gfc_get_corank (expr);
+ for (n = ss->data.info.dimen; n < ss->data.info.dimen + codim - 1;
+ n++)
+ {
+ gfc_conv_section_startstride (&loop, ss, n, true, false);
+ loop.from[n] = info->start[n];
+ loop.to[n] = info->end[n];
+ }
+
+ gcc_assert (n == ss->data.info.dimen + codim - 1);
+ evaluate_bound (&loop.pre, info->start, info->ref->u.ar.start,
+ info->descriptor, n, true);
+ loop.from[n] = info->start[n];
+ }
else
codim = 0;