Commit f44d2277 by Mikael Morin

trans-array.h (gfc_trans_create_temp_array): Replace info argument with ss argument.

	* trans-array.h (gfc_trans_create_temp_array): Replace info argument
	with ss argument.
	* trans-array.c (gfc_trans_create_temp_array): Ditto. Get info from ss.
	(gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
	gfc_trans_create_temp_array.
	* trans-expr.c (gfc_conv_procedure_call): Ditto.
	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
	* trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.

From-SVN: r180859
parent 14bf3267
2011-11-03 Mikael Morin <mikael@gcc.gnu.org> 2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.h (gfc_trans_create_temp_array): Replace info argument
with ss argument.
* trans-array.c (gfc_trans_create_temp_array): Ditto. Get info from ss.
(gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
gfc_trans_create_temp_array.
* trans-expr.c (gfc_conv_procedure_call): Ditto.
* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
* trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_trans_array_bound_check): Use ss argument * trans-array.c (gfc_trans_array_bound_check): Use ss argument
to get name. to get name.
......
...@@ -838,10 +838,11 @@ get_array_ref_dim (gfc_ss_info *info, int loop_dim) ...@@ -838,10 +838,11 @@ get_array_ref_dim (gfc_ss_info *info, int loop_dim)
tree tree
gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
gfc_loopinfo * loop, gfc_ss_info * info, gfc_loopinfo * loop, gfc_ss * ss,
tree eltype, tree initial, bool dynamic, tree eltype, tree initial, bool dynamic,
bool dealloc, bool callee_alloc, locus * where) bool dealloc, bool callee_alloc, locus * where)
{ {
gfc_ss_info *info;
tree from[GFC_MAX_DIMENSIONS], to[GFC_MAX_DIMENSIONS]; tree from[GFC_MAX_DIMENSIONS], to[GFC_MAX_DIMENSIONS];
tree type; tree type;
tree desc; tree desc;
...@@ -855,6 +856,8 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, ...@@ -855,6 +856,8 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
memset (from, 0, sizeof (from)); memset (from, 0, sizeof (from));
memset (to, 0, sizeof (to)); memset (to, 0, sizeof (to));
info = &ss->data.info;
gcc_assert (info->dimen > 0); gcc_assert (info->dimen > 0);
gcc_assert (loop->dimen == info->dimen); gcc_assert (loop->dimen == info->dimen);
...@@ -2038,7 +2041,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where) ...@@ -2038,7 +2041,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
if (TREE_CODE (loop->to[0]) == VAR_DECL) if (TREE_CODE (loop->to[0]) == VAR_DECL)
dynamic = true; dynamic = true;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &ss->data.info, gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, ss,
type, NULL_TREE, dynamic, true, false, where); type, NULL_TREE, dynamic, true, false, where);
desc = ss->data.info.descriptor; desc = ss->data.info.descriptor;
...@@ -4061,7 +4064,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) ...@@ -4061,7 +4064,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
loop->temp_ss->data.info.dim[n] = n; loop->temp_ss->data.info.dim[n] = n;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, gfc_trans_create_temp_array (&loop->pre, &loop->post, loop,
&loop->temp_ss->data.info, tmp, NULL_TREE, loop->temp_ss, tmp, NULL_TREE,
false, true, false, where); false, true, false, where);
} }
......
...@@ -32,7 +32,7 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *, ...@@ -32,7 +32,7 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *,
/* Generate code to create a temporary array. */ /* Generate code to create a temporary array. */
tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *, tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *,
gfc_ss_info *, tree, tree, bool, bool, bool, gfc_ss *, tree, tree, bool, bool, bool,
locus *); locus *);
/* Generate function entry code for allocation of compiler allocated array /* Generate function entry code for allocation of compiler allocated array
......
...@@ -3602,8 +3602,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -3602,8 +3602,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
returns a pointer, the temporary will be a shallow copy and returns a pointer, the temporary will be a shallow copy and
mustn't be deallocated. */ mustn't be deallocated. */
callee_alloc = comp->attr.allocatable || comp->attr.pointer; callee_alloc = comp->attr.allocatable || comp->attr.pointer;
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp, gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss,
NULL_TREE, false, !comp->attr.pointer, tmp, NULL_TREE, false,
!comp->attr.pointer,
callee_alloc, &se->ss->expr->where); callee_alloc, &se->ss->expr->where);
/* Pass the temporary as the first argument. */ /* Pass the temporary as the first argument. */
...@@ -3637,8 +3638,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -3637,8 +3638,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
returns a pointer, the temporary will be a shallow copy and returns a pointer, the temporary will be a shallow copy and
mustn't be deallocated. */ mustn't be deallocated. */
callee_alloc = sym->attr.allocatable || sym->attr.pointer; callee_alloc = sym->attr.allocatable || sym->attr.pointer;
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp, gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss,
NULL_TREE, false, !sym->attr.pointer, tmp, NULL_TREE, false,
!sym->attr.pointer,
callee_alloc, &se->ss->expr->where); callee_alloc, &se->ss->expr->where);
/* Pass the temporary as the first argument. */ /* Pass the temporary as the first argument. */
......
...@@ -5502,7 +5502,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) ...@@ -5502,7 +5502,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
/* Build a destination descriptor, using the pointer, source, as the /* Build a destination descriptor, using the pointer, source, as the
data field. */ data field. */
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, gfc_trans_create_temp_array (&se->pre, &se->post, se->loop,
info, mold_type, NULL_TREE, false, true, false, se->ss, mold_type, NULL_TREE, false, true, false,
&expr->where); &expr->where);
/* Cast the pointer to the result. */ /* Cast the pointer to the result. */
......
...@@ -310,7 +310,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, ...@@ -310,7 +310,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
data = gfc_create_var (pvoid_type_node, NULL); data = gfc_create_var (pvoid_type_node, NULL);
gfc_init_block (&temp_post); gfc_init_block (&temp_post);
tmp = gfc_trans_create_temp_array (&se->pre, &temp_post, tmp = gfc_trans_create_temp_array (&se->pre, &temp_post,
&tmp_loop, info, temptype, &tmp_loop, ss, temptype,
initial, initial,
false, true, false, false, true, false,
&arg->expr->where); &arg->expr->where);
......
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