* resolve.c (resolve_array_ref): Set array_ref's dimen field (and the
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 19:56:11 +0000 (19:56 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 19:56:11 +0000 (19:56 +0000)
associated dimen_type) in the full array ref case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179685 138bc75d-0d04-0410-961f-82ee72b054a4

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

index e7a9941..ad9c722 100644 (file)
@@ -1,5 +1,10 @@
 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.
        (convert_element_to_coarray_ref): Move code to walk_coarray. Remove.
        (trans-this_image, trans_image_index, conv_intrinsic_cobound):
index e6770db..edeb49d 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.  */