Commit fa168d9f by Mikael Morin

trans-array.c (gfc_trans_array_constructor): Loop over the parents.

	* trans-array.c (gfc_trans_array_constructor): Loop over the parents.

From-SVN: r180891
parent 5125d6d5
2011-11-03 Mikael Morin <mikael@gcc.gnu.org> 2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_array_constructor): Loop over the parents.
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_set_loop_bounds_from_array_spec): Loop over the * trans-array.c (gfc_set_loop_bounds_from_array_spec): Loop over the
parents. parents.
......
...@@ -1953,6 +1953,7 @@ trans_constant_array_constructor (gfc_ss * ss, tree type) ...@@ -1953,6 +1953,7 @@ trans_constant_array_constructor (gfc_ss * ss, tree type)
} }
} }
/* Helper routine of gfc_trans_array_constructor to determine if the /* Helper routine of gfc_trans_array_constructor to determine if the
bounds of the loop specified by LOOP are constant and simple enough bounds of the loop specified by LOOP are constant and simple enough
to use with trans_constant_array_constructor. Returns the to use with trans_constant_array_constructor. Returns the
...@@ -2010,6 +2011,7 @@ trans_array_constructor (gfc_ss * ss, locus * where) ...@@ -2010,6 +2011,7 @@ trans_array_constructor (gfc_ss * ss, locus * where)
gfc_loopinfo *loop; gfc_loopinfo *loop;
gfc_ss_info *ss_info; gfc_ss_info *ss_info;
gfc_expr *expr; gfc_expr *expr;
gfc_ss *s;
/* Save the old values for nested checking. */ /* Save the old values for nested checking. */
old_first_len = first_len; old_first_len = first_len;
...@@ -2078,16 +2080,20 @@ trans_array_constructor (gfc_ss * ss, locus * where) ...@@ -2078,16 +2080,20 @@ trans_array_constructor (gfc_ss * ss, locus * where)
if (expr->shape && loop->dimen > 1 && loop->to[0] == NULL_TREE) if (expr->shape && loop->dimen > 1 && loop->to[0] == NULL_TREE)
{ {
/* We have a multidimensional parameter. */ /* We have a multidimensional parameter. */
int n; for (s = ss; s; s = s->parent)
for (n = 0; n < expr->rank; n++) {
{ int n;
loop->from[n] = gfc_index_zero_node; for (n = 0; n < s->loop->dimen; n++)
loop->to[n] = gfc_conv_mpz_to_tree (expr->shape [n], {
gfc_index_integer_kind); s->loop->from[n] = gfc_index_zero_node;
loop->to[n] = fold_build2_loc (input_location, MINUS_EXPR, s->loop->to[n] = gfc_conv_mpz_to_tree (expr->shape[s->dim[n]],
gfc_array_index_type, gfc_index_integer_kind);
loop->to[n], gfc_index_one_node); s->loop->to[n] = fold_build2_loc (input_location, MINUS_EXPR,
} gfc_array_index_type,
s->loop->to[n],
gfc_index_one_node);
}
}
} }
if (loop->to[0] == NULL_TREE) if (loop->to[0] == NULL_TREE)
......
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