resolve.c (resolve_array_ref): Set array_ref's dimen field (and the associated dimen_...
authorMikael Morin <mikael.morin@sfr.fr>
Fri, 7 Oct 2011 19:56:11 +0000 (21:56 +0200)
committerMikael Morin <mikael@gcc.gnu.org>
Fri, 7 Oct 2011 19:56:11 +0000 (19:56 +0000)
* resolve.c (resolve_array_ref): Set array_ref's dimen field (and the
associated dimen_type) in the full array ref case.

From-SVN: r179685

gcc/fortran/ChangeLog
gcc/fortran/resolve.c

index e7a9941b9cfa9f8df931ed3f130d5653a2ee9ca2..ad9c722ec7fafdb3ce09b27b35213698a5028f09 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
+
+       * 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  <mikael.morin@sfr.fr>
 
        * trans-intrinsic.c (walk_coarray): New function.
index e6770db07ab090d8de47d1b80bdd36e2c2dd48fa..edeb49daf7dd49129a308793fefa5b23039ea1be 100644 (file)
@@ -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.  */