trans-array.c (gfc_conv_section_startstride): Factor common array ref references.
authorMikael Morin <mikael.morin@sfr.fr>
Fri, 7 Oct 2011 19:33:10 +0000 (21:33 +0200)
committerMikael Morin <mikael@gcc.gnu.org>
Fri, 7 Oct 2011 19:33:10 +0000 (19:33 +0000)
* trans-array.c (gfc_conv_section_startstride): Factor common
array ref references.

From-SVN: r179679

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

index 78f6885aeb8ebed3e77c52ab5e4e773d45b0cff0..349e96a2cbc3dd3540f8ff94a9db6e43d8fd7b6f 100644 (file)
@@ -1,3 +1,8 @@
+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
index 0f5f29ccb1d0ee0a37dc2ff9b7e4baf5e81d0fd8..7cc86ba2673bf83da537bf3af056aa513f1869ef 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.  */