diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 67e2bcf3dfb..b1b0407fcc8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-10-18 Mikael Morin + + PR fortran/50420 + * trans-array.c (gfc_walk_array_ref): Allow zero rank arrays + if they are coarrays. + 2011-10-18 Mikael Morin * trans-array.h (gfc_walk_array_ref): New prototype. diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 89528b47239..3472804e4c6 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -7700,8 +7700,10 @@ gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref) gcc_unreachable (); } } - /* We should have at least one non-elemental dimension. */ - gcc_assert (newss->data.info.dimen > 0); + /* We should have at least one non-elemental dimension, + unless we are creating a descriptor for a (scalar) coarray. */ + gcc_assert (newss->data.info.dimen > 0 + || newss->data.info.ref->u.ar.as->corank > 0); ss = newss; break;