Commit 42ac5ee1 by Mikael Morin

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
parent 700535b7
2011-10-18 Mikael Morin <mikael@gcc.gnu.org> 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 PR fortran/50420
* trans-array.c (gfc_conv_expr_descriptor): Use loop.dimen instead of * trans-array.c (gfc_conv_expr_descriptor): Use loop.dimen instead of
ndim for the descriptor's rank. ndim for the descriptor's rank.
......
...@@ -7603,14 +7603,22 @@ static gfc_ss * ...@@ -7603,14 +7603,22 @@ static gfc_ss *
gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
{ {
gfc_ref *ref; gfc_ref *ref;
gfc_array_ref *ar;
gfc_ss *newss;
int n;
for (ref = expr->ref; ref; ref = ref->next) for (ref = expr->ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT) if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
break; 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) for (; ref; ref = ref->next)
{ {
if (ref->type == REF_SUBSTRING) if (ref->type == REF_SUBSTRING)
......
...@@ -70,6 +70,8 @@ void gfc_trans_static_array_pointer (gfc_symbol *); ...@@ -70,6 +70,8 @@ void gfc_trans_static_array_pointer (gfc_symbol *);
gfc_ss *gfc_walk_expr (gfc_expr *); gfc_ss *gfc_walk_expr (gfc_expr *);
/* Workhorse for gfc_walk_expr. */ /* Workhorse for gfc_walk_expr. */
gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_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. */ /* Walk the arguments of an elemental function. */
gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *, gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *,
gfc_ss_type); gfc_ss_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment