Commit cb4b9eae by Mikael Morin

trans.h (struct gfc_array_info): Move dim and dimen fields...

	* trans.h (struct gfc_array_info): Move dim and dimen fields...
	(struct gfc_ss): ... here.  Remove gfc_ss::data::temp::dimen field.
	* trans-array.c (gfc_conv_loop_setup): Remove temp_ss dim array
	initialization.
	(gfc_get_temp_ss): Initialize dim and dimen.
	(gfc_free_ss, gfc_get_array_ss, gfc_get_temp_ss,
	gfc_set_loop_bounds_from_array_spec, get_array_ref_dim,
	gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
	gfc_set_vector_loop_bounds, gfc_conv_scalarized_array_ref,
	gfc_trans_preloop_setup, gfc_conv_ss_startstride,
	gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims,
	gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment,
	gfc_walk_array_ref): Update field references.
	* trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
	Ditto.
	* trans-intrinsic.c (walk_inline_intrinsic_transpose): Ditto.
	* trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.

From-SVN: r180865
parent 6d63e468
2011-11-03 Mikael Morin <mikael@gcc.gnu.org> 2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans.h (struct gfc_array_info): Move dim and dimen fields...
(struct gfc_ss): ... here. Remove gfc_ss::data::temp::dimen field.
* trans-array.c (gfc_conv_loop_setup): Remove temp_ss dim array
initialization.
(gfc_get_temp_ss): Initialize dim and dimen.
(gfc_free_ss, gfc_get_array_ss, gfc_get_temp_ss,
gfc_set_loop_bounds_from_array_spec, get_array_ref_dim,
gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
gfc_set_vector_loop_bounds, gfc_conv_scalarized_array_ref,
gfc_trans_preloop_setup, gfc_conv_ss_startstride,
gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims,
gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment,
gfc_walk_array_ref): Update field references.
* trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
Ditto.
* trans-intrinsic.c (walk_inline_intrinsic_transpose): Ditto.
* trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans.h (struct gfc_ss_info, struct gfc_array_info): * trans.h (struct gfc_ss_info, struct gfc_array_info):
Rename the former to the latter. Rename the former to the latter.
* trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage, * trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage,
......
...@@ -2489,7 +2489,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77, ...@@ -2489,7 +2489,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
outside the innermost loop, so the overall transfer could be outside the innermost loop, so the overall transfer could be
optimized further. */ optimized further. */
info = &rse.ss->data.info; info = &rse.ss->data.info;
dimen = info->dimen; dimen = rse.ss->dimen;
tmp_index = gfc_index_zero_node; tmp_index = gfc_index_zero_node;
for (n = dimen - 1; n > 0; n--) for (n = dimen - 1; n > 0; n--)
...@@ -3582,7 +3582,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -3582,7 +3582,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Set the type of the array. */ /* Set the type of the array. */
tmp = gfc_typenode_for_spec (&comp->ts); tmp = gfc_typenode_for_spec (&comp->ts);
gcc_assert (info->dimen == se->loop->dimen); gcc_assert (se->ss->dimen == se->loop->dimen);
/* Evaluate the bounds of the result, if known. */ /* Evaluate the bounds of the result, if known. */
gfc_set_loop_bounds_from_array_spec (&mapping, se, comp->as); gfc_set_loop_bounds_from_array_spec (&mapping, se, comp->as);
...@@ -3618,7 +3618,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -3618,7 +3618,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Set the type of the array. */ /* Set the type of the array. */
tmp = gfc_typenode_for_spec (&ts); tmp = gfc_typenode_for_spec (&ts);
gcc_assert (info->dimen == se->loop->dimen); gcc_assert (se->ss->dimen == se->loop->dimen);
/* Evaluate the bounds of the result, if known. */ /* Evaluate the bounds of the result, if known. */
gfc_set_loop_bounds_from_array_spec (&mapping, se, sym->result->as); gfc_set_loop_bounds_from_array_spec (&mapping, se, sym->result->as);
......
...@@ -6757,15 +6757,13 @@ walk_inline_intrinsic_transpose (gfc_ss *ss, gfc_expr *expr) ...@@ -6757,15 +6757,13 @@ walk_inline_intrinsic_transpose (gfc_ss *ss, gfc_expr *expr)
&& tmp_ss->type != GFC_SS_REFERENCE) && tmp_ss->type != GFC_SS_REFERENCE)
{ {
int tmp_dim; int tmp_dim;
gfc_array_info *info;
info = &tmp_ss->data.info; gcc_assert (tmp_ss->dimen == 2);
gcc_assert (info->dimen == 2);
/* We just invert dimensions. */ /* We just invert dimensions. */
tmp_dim = info->dim[0]; tmp_dim = tmp_ss->dim[0];
info->dim[0] = info->dim[1]; tmp_ss->dim[0] = tmp_ss->dim[1];
info->dim[1] = tmp_dim; tmp_ss->dim[1] = tmp_dim;
} }
/* Stop when tmp_ss points to the last valid element of the chain... */ /* Stop when tmp_ss points to the last valid element of the chain... */
......
...@@ -241,8 +241,8 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, ...@@ -241,8 +241,8 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
/* Make a local loopinfo for the temporary creation, so that /* Make a local loopinfo for the temporary creation, so that
none of the other ss->info's have to be renormalized. */ none of the other ss->info's have to be renormalized. */
gfc_init_loopinfo (&tmp_loop); gfc_init_loopinfo (&tmp_loop);
tmp_loop.dimen = info->dimen; tmp_loop.dimen = ss->dimen;
for (n = 0; n < info->dimen; n++) for (n = 0; n < ss->dimen; n++)
{ {
tmp_loop.to[n] = loopse->loop->to[n]; tmp_loop.to[n] = loopse->loop->to[n];
tmp_loop.from[n] = loopse->loop->from[n]; tmp_loop.from[n] = loopse->loop->from[n];
...@@ -320,7 +320,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, ...@@ -320,7 +320,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
/* Calculate the offset for the temporary. */ /* Calculate the offset for the temporary. */
offset = gfc_index_zero_node; offset = gfc_index_zero_node;
for (n = 0; n < info->dimen; n++) for (n = 0; n < ss->dimen; n++)
{ {
tmp = gfc_conv_descriptor_stride_get (info->descriptor, tmp = gfc_conv_descriptor_stride_get (info->descriptor,
gfc_rank_cst[n]); gfc_rank_cst[n]);
......
...@@ -113,7 +113,6 @@ gfc_coarray_type; ...@@ -113,7 +113,6 @@ gfc_coarray_type;
typedef struct gfc_array_info typedef struct gfc_array_info
{ {
int dimen;
/* The ref that holds information on this section. */ /* The ref that holds information on this section. */
gfc_ref *ref; gfc_ref *ref;
/* The descriptor of this array. */ /* The descriptor of this array. */
...@@ -134,10 +133,6 @@ typedef struct gfc_array_info ...@@ -134,10 +133,6 @@ typedef struct gfc_array_info
tree end[GFC_MAX_DIMENSIONS]; tree end[GFC_MAX_DIMENSIONS];
tree stride[GFC_MAX_DIMENSIONS]; tree stride[GFC_MAX_DIMENSIONS];
tree delta[GFC_MAX_DIMENSIONS]; tree delta[GFC_MAX_DIMENSIONS];
/* Translation from loop dimensions to actual dimensions.
actual_dim = dim[loop_dim] */
int dim[GFC_MAX_DIMENSIONS];
} }
gfc_array_info; gfc_array_info;
...@@ -212,9 +207,6 @@ typedef struct gfc_ss ...@@ -212,9 +207,6 @@ typedef struct gfc_ss
/* GFC_SS_TEMP. */ /* GFC_SS_TEMP. */
struct struct
{ {
/* The rank of the temporary. May be less than the rank of the
assigned expression. */
int dimen;
tree type; tree type;
} }
temp; temp;
...@@ -223,6 +215,11 @@ typedef struct gfc_ss ...@@ -223,6 +215,11 @@ typedef struct gfc_ss
} }
data; data;
int dimen;
/* Translation from loop dimensions to actual array dimensions.
actual_dim = dim[loop_dim] */
int dim[GFC_MAX_DIMENSIONS];
/* All the SS in a loop and linked through loop_chain. The SS for an /* All the SS in a loop and linked through loop_chain. The SS for an
expression are linked by the next pointer. */ expression are linked by the next pointer. */
struct gfc_ss *loop_chain; struct gfc_ss *loop_chain;
......
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