]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 67e2bcf3dfb184f30d0ebb25cd3e662375765a23..b1b0407fcc8a5fdbf6e443eb59fe855452146902 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 89528b472394d18898330bb37fdc377cdf76ba25..3472804e4c6344e68d15af2feee627429ca61018 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;