From e3cdb7cf9a0d934b9cdc24d40d730141e5752f60 Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Thu, 9 Sep 2010 14:12:08 +0000 Subject: [PATCH] trans-array.c (gfc_set_loop_bounds_from_array_spec): Get the array dimension from the dim array. 2010-09-09 Mikael Morin * trans-array.c (gfc_set_loop_bounds_from_array_spec): Get the array dimension from the dim array. From-SVN: r164109 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-array.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2483ad9bea7..6525253fe54 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2010-09-09 Mikael Morin + + * trans-array.c (gfc_set_loop_bounds_from_array_spec): + Get the array dimension from the dim array. + 2010-09-09 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Unconditionally use the diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index e0bc34fe3b0..a5da4741230 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -562,9 +562,11 @@ gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping * mapping, tree tmp; if (as && as->type == AS_EXPLICIT) - for (dim = 0; dim < se->loop->dimen; dim++) + for (n = 0; n < se->loop->dimen; n++) { - n = se->loop->order[dim]; + dim = se->ss->data.info.dim[n]; + gcc_assert (dim < as->rank); + gcc_assert (se->loop->dimen == as->rank); if (se->loop->to[n] == NULL_TREE) { /* Evaluate the lower bound. */