diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2011-11-03 23:28:25 +0000 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2011-11-03 23:28:25 +0000 |
commit | f49afcb009a548aa46c36344d8ebe4d0648ae429 (patch) | |
tree | 024f6e9768a09ecece8f3d11bcff9d4a7a43f140 /gcc | |
parent | fa168d9ff4f07bde598f8d924f5c854127598f6e (diff) | |
download | gcc-f49afcb009a548aa46c36344d8ebe4d0648ae429.zip gcc-f49afcb009a548aa46c36344d8ebe4d0648ae429.tar.gz gcc-f49afcb009a548aa46c36344d8ebe4d0648ae429.tar.bz2 |
trans-array.c (set_vector_loop_bounds): Loop over the parents.
* trans-array.c (set_vector_loop_bounds): Loop over the parents.
From-SVN: r180892
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 196f3da..47c4938 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,9 @@ 2011-11-03 Mikael Morin <mikael@gcc.gnu.org> + * trans-array.c (set_vector_loop_bounds): Loop over the parents. + +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> diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 463a0a2..25d9a37 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -2197,14 +2197,18 @@ set_vector_loop_bounds (gfc_ss * ss) int dim; info = &ss->info->data.array; - loop = ss->loop; - for (n = 0; n < loop->dimen; n++) + for (; ss; ss = ss->parent) { - dim = ss->dim[n]; - if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR - && loop->to[n] == NULL) + loop = ss->loop; + + for (n = 0; n < loop->dimen; n++) { + dim = ss->dim[n]; + if (info->ref->u.ar.dimen_type[dim] != DIMEN_VECTOR + || loop->to[n] != NULL) + continue; + /* Loop variable N indexes vector dimension DIM, and we don't yet know the upper bound of loop variable N. Set it to the difference between the vector's upper and lower bounds. */ |