]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-array.h (gfc_walk_array_ref): New prototype.
authorMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 14:53:43 +0000 (14:53 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 14:53:43 +0000 (14:53 +0000)
* trans-array.h (gfc_walk_array_ref): New prototype.
* trans-array.c (gfc_walk_array_ref): New function, containing
all but the beginning of gfc_walk_variable_expr's code.
(gfc_walk_variable_expr): Use gfc_walk_array_ref.

From-SVN: r180144

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

index 1cea460f3dbaed4e3821672450a57f14194d9299..67e2bcf3dfb184f30d0ebb25cd3e662375765a23 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans-array.h (gfc_walk_array_ref): New prototype.
+       * trans-array.c (gfc_walk_array_ref): New function, containing
+       all but the beginning of gfc_walk_variable_expr's code.
+       (gfc_walk_variable_expr): Use gfc_walk_array_ref.
+
 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/50420
index 06a81f1db71b66bbb052bdbb66a144fdfcddc8ad..89528b472394d18898330bb37fdc377cdf76ba25 100644 (file)
@@ -7603,14 +7603,22 @@ static gfc_ss *
 gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
 {
   gfc_ref *ref;
-  gfc_array_ref *ar;
-  gfc_ss *newss;
-  int n;
 
   for (ref = expr->ref; ref; ref = ref->next)
     if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
       break;
 
+  return gfc_walk_array_ref (ss, expr, ref);
+}
+
+
+gfc_ss *
+gfc_walk_array_ref (gfc_ss * ss, gfc_expr * expr, gfc_ref * ref)
+{
+  gfc_array_ref *ar;
+  gfc_ss *newss;
+  int n;
+
   for (; ref; ref = ref->next)
     {
       if (ref->type == REF_SUBSTRING)
index 73d8c40c9e9d5490dcc7d3fd5c02a2b10cddc19c..4d737bde94f8ba9b46ff939fe1190ffa22ed7f2e 100644 (file)
@@ -70,6 +70,8 @@ void gfc_trans_static_array_pointer (gfc_symbol *);
 gfc_ss *gfc_walk_expr (gfc_expr *);
 /* Workhorse for gfc_walk_expr.  */
 gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_expr *);
+/* Workhorse for gfc_walk_variable_expr.  */
+gfc_ss *gfc_walk_array_ref (gfc_ss *, gfc_expr *, gfc_ref * ref);
 /* Walk the arguments of an elemental function.  */
 gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *,
                                          gfc_ss_type);