re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents)
authorMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 14:55:48 +0000 (14:55 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 14:55:48 +0000 (14:55 +0000)
PR fortran/50420
* trans-array.c (gfc_walk_array_ref): Allow zero rank arrays
if they are coarrays.

From-SVN: r180145

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c

index 67e2bcf..b1b0407 100644 (file)
@@ -1,5 +1,11 @@
 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
 
+       PR fortran/50420
+       * trans-array.c (gfc_walk_array_ref): Allow zero rank arrays
+       if they are coarrays.
+
+2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
+
        * trans-array.h (gfc_walk_array_ref): New prototype.
        * trans-array.c (gfc_walk_array_ref): New function, containing
        all but the beginning of gfc_walk_variable_expr's code.
index 89528b4..3472804 100644 (file)
@@ -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;