diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e7a9941b9cf..ad9c722ec7f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-10-07 Mikael Morin + + * resolve.c (resolve_array_ref): Set array_ref's dimen field (and the + associated dimen_type) in the full array ref case. + 2011-10-07 Mikael Morin * trans-intrinsic.c (walk_coarray): New function. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index e6770db07ab..edeb49daf7d 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -4644,8 +4644,23 @@ resolve_array_ref (gfc_array_ref *ar) } } - if (ar->type == AR_FULL && ar->as->rank == 0) - ar->type = AR_ELEMENT; + if (ar->type == AR_FULL) + { + if (ar->as->rank == 0) + ar->type = AR_ELEMENT; + + /* Make sure array is the same as array(:,:), this way + we don't need to special case all the time. */ + ar->dimen = ar->as->rank; + for (i = 0; i < ar->dimen; i++) + { + ar->dimen_type[i] = DIMEN_RANGE; + + gcc_assert (ar->start[i] == NULL); + gcc_assert (ar->end[i] == NULL); + gcc_assert (ar->stride[i] == NULL); + } + } /* If the reference type is unknown, figure out what kind it is. */