trans-array.h (gfc_walk_array_ref): New prototype.

* 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
This commit is contained in:
Mikael Morin 2011-10-18 14:53:43 +00:00
parent 700535b75f
commit 42ac5ee128
3 changed files with 20 additions and 3 deletions

View 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

View 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)

View 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);