OSDN Git Service

* trans-array.c (gfc_conv_section_startstride): Factor common
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 19:33:10 +0000 (19:33 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 19:33:10 +0000 (19:33 +0000)
array ref references.

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

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

index 78f6885..349e96a 100644 (file)
@@ -1,5 +1,10 @@
 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
 
+       * trans-array.c (gfc_conv_section_startstride): Factor common
+       array ref references.
+
+2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
+
        * trans-array.c (gfc_conv_expr_descriptor): Use codim instead of
        loop.codimen as argument to gfc_get_array_type_bounds.
 
index 0f5f29c..7cc86ba 100644 (file)
@@ -3187,12 +3187,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
   tree desc;
   gfc_se se;
   gfc_ss_info *info;
+  gfc_array_ref *ar;
 
   gcc_assert (ss->type == GFC_SS_SECTION);
 
   info = &ss->data.info;
+  ar = &info->ref->u.ar;
 
-  if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
+  if (ar->dimen_type[dim] == DIMEN_VECTOR)
     {
       /* We use a zero-based index to access the vector.  */
       info->start[dim] = gfc_index_zero_node;
@@ -3202,12 +3204,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim,
       return;
     }
 
-  gcc_assert (info->ref->u.ar.dimen_type[dim] == DIMEN_RANGE);
+  gcc_assert (ar->dimen_type[dim] == DIMEN_RANGE);
   desc = info->descriptor;
-  start = info->ref->u.ar.start[dim];
-  end = info->ref->u.ar.end[dim];
+  start = ar->start[dim];
+  end = ar->end[dim];
   if (!coarray)
-    stride = info->ref->u.ar.stride[dim];
+    stride = ar->stride[dim];
 
   /* Calculate the start of the range.  For vector subscripts this will
      be the range of the vector.  */