Commit 568e8e1e by Paul Thomas

trans-array.h: Replace prototypes for gfc_conv_descriptor_offset...

2009-06-08  Paul Thomas  <pault@gcc.gnu.org>

	* trans-array.h : Replace prototypes for
	gfc_conv_descriptor_offset, gfc_conv_descriptor_stride,
	gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound with new
	prototypes of the same names with _get or _set appended.
	* trans-array.c : Make the originals of the above static and
	new functions for the _get and _set functions. Update all the
	references to these descriptor access functions.
	* trans-expr.c : Update references to the above descriptor
	access functions.
	* trans-intrinsic.c : The same.
	* trans-openmp.c : The same.
	* trans-stmt.c : The same.

From-SVN: r148290
parent 72e48218
...@@ -197,7 +197,7 @@ gfc_conv_descriptor_data_addr (tree desc) ...@@ -197,7 +197,7 @@ gfc_conv_descriptor_data_addr (tree desc)
return gfc_build_addr_expr (NULL_TREE, t); return gfc_build_addr_expr (NULL_TREE, t);
} }
tree static tree
gfc_conv_descriptor_offset (tree desc) gfc_conv_descriptor_offset (tree desc)
{ {
tree type; tree type;
...@@ -214,6 +214,21 @@ gfc_conv_descriptor_offset (tree desc) ...@@ -214,6 +214,21 @@ gfc_conv_descriptor_offset (tree desc)
} }
tree tree
gfc_conv_descriptor_offset_get (tree desc)
{
return gfc_conv_descriptor_offset (desc);
}
void
gfc_conv_descriptor_offset_set (stmtblock_t *block, tree desc,
tree value)
{
tree t = gfc_conv_descriptor_offset (desc);
gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value));
}
tree
gfc_conv_descriptor_dtype (tree desc) gfc_conv_descriptor_dtype (tree desc)
{ {
tree field; tree field;
...@@ -250,7 +265,7 @@ gfc_conv_descriptor_dimension (tree desc, tree dim) ...@@ -250,7 +265,7 @@ gfc_conv_descriptor_dimension (tree desc, tree dim)
return tmp; return tmp;
} }
tree static tree
gfc_conv_descriptor_stride (tree desc, tree dim) gfc_conv_descriptor_stride (tree desc, tree dim)
{ {
tree tmp; tree tmp;
...@@ -267,6 +282,20 @@ gfc_conv_descriptor_stride (tree desc, tree dim) ...@@ -267,6 +282,20 @@ gfc_conv_descriptor_stride (tree desc, tree dim)
} }
tree tree
gfc_conv_descriptor_stride_get (tree desc, tree dim)
{
return gfc_conv_descriptor_stride (desc, dim);
}
void
gfc_conv_descriptor_stride_set (stmtblock_t *block, tree desc,
tree dim, tree value)
{
tree t = gfc_conv_descriptor_stride (desc, dim);
gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value));
}
static tree
gfc_conv_descriptor_lbound (tree desc, tree dim) gfc_conv_descriptor_lbound (tree desc, tree dim)
{ {
tree tmp; tree tmp;
...@@ -283,6 +312,20 @@ gfc_conv_descriptor_lbound (tree desc, tree dim) ...@@ -283,6 +312,20 @@ gfc_conv_descriptor_lbound (tree desc, tree dim)
} }
tree tree
gfc_conv_descriptor_lbound_get (tree desc, tree dim)
{
return gfc_conv_descriptor_lbound (desc, dim);
}
void
gfc_conv_descriptor_lbound_set (stmtblock_t *block, tree desc,
tree dim, tree value)
{
tree t = gfc_conv_descriptor_lbound (desc, dim);
gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value));
}
static tree
gfc_conv_descriptor_ubound (tree desc, tree dim) gfc_conv_descriptor_ubound (tree desc, tree dim)
{ {
tree tmp; tree tmp;
...@@ -298,6 +341,19 @@ gfc_conv_descriptor_ubound (tree desc, tree dim) ...@@ -298,6 +341,19 @@ gfc_conv_descriptor_ubound (tree desc, tree dim)
return tmp; return tmp;
} }
tree
gfc_conv_descriptor_ubound_get (tree desc, tree dim)
{
return gfc_conv_descriptor_ubound (desc, dim);
}
void
gfc_conv_descriptor_ubound_set (stmtblock_t *block, tree desc,
tree dim, tree value)
{
tree t = gfc_conv_descriptor_ubound (desc, dim);
gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value));
}
/* Build a null array descriptor constructor. */ /* Build a null array descriptor constructor. */
...@@ -592,8 +648,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, ...@@ -592,8 +648,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
/* The offset is zero because we create temporaries with a zero /* The offset is zero because we create temporaries with a zero
lower bound. */ lower bound. */
tmp = gfc_conv_descriptor_offset (desc); gfc_conv_descriptor_offset_set (pre, desc, gfc_index_zero_node);
gfc_add_modify (pre, tmp, gfc_index_zero_node);
if (dealloc && !onstack) if (dealloc && !onstack)
{ {
...@@ -704,21 +759,19 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, ...@@ -704,21 +759,19 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
of the descriptor fields. */ of the descriptor fields. */
tmp = tmp =
fold_build2 (MINUS_EXPR, gfc_array_index_type, fold_build2 (MINUS_EXPR, gfc_array_index_type,
gfc_conv_descriptor_ubound (desc, gfc_rank_cst[n]), gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[n]),
gfc_conv_descriptor_lbound (desc, gfc_rank_cst[n])); gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n]));
loop->to[n] = tmp; loop->to[n] = tmp;
continue; continue;
} }
/* Store the stride and bound components in the descriptor. */ /* Store the stride and bound components in the descriptor. */
tmp = gfc_conv_descriptor_stride (desc, gfc_rank_cst[n]); gfc_conv_descriptor_stride_set (pre, desc, gfc_rank_cst[n], size);
gfc_add_modify (pre, tmp, size);
tmp = gfc_conv_descriptor_lbound (desc, gfc_rank_cst[n]); gfc_conv_descriptor_lbound_set (pre, desc, gfc_rank_cst[n],
gfc_add_modify (pre, tmp, gfc_index_zero_node); gfc_index_zero_node);
tmp = gfc_conv_descriptor_ubound (desc, gfc_rank_cst[n]); gfc_conv_descriptor_ubound_set (pre, desc, gfc_rank_cst[n], loop->to[n]);
gfc_add_modify (pre, tmp, loop->to[n]);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
loop->to[n], gfc_index_one_node); loop->to[n], gfc_index_one_node);
...@@ -820,25 +873,22 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr) ...@@ -820,25 +873,22 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr)
dest_index = gfc_rank_cst[n]; dest_index = gfc_rank_cst[n];
src_index = gfc_rank_cst[1 - n]; src_index = gfc_rank_cst[1 - n];
gfc_add_modify (&se->pre, gfc_conv_descriptor_stride_set (&se->pre, dest, dest_index,
gfc_conv_descriptor_stride (dest, dest_index), gfc_conv_descriptor_stride_get (src, src_index));
gfc_conv_descriptor_stride (src, src_index));
gfc_add_modify (&se->pre, gfc_conv_descriptor_lbound_set (&se->pre, dest, dest_index,
gfc_conv_descriptor_lbound (dest, dest_index), gfc_conv_descriptor_lbound_get (src, src_index));
gfc_conv_descriptor_lbound (src, src_index));
gfc_add_modify (&se->pre, gfc_conv_descriptor_ubound_set (&se->pre, dest, dest_index,
gfc_conv_descriptor_ubound (dest, dest_index), gfc_conv_descriptor_ubound_get (src, src_index));
gfc_conv_descriptor_ubound (src, src_index));
if (!loop->to[n]) if (!loop->to[n])
{ {
gcc_assert (integer_zerop (loop->from[n])); gcc_assert (integer_zerop (loop->from[n]));
loop->to[n] = loop->to[n] =
fold_build2 (MINUS_EXPR, gfc_array_index_type, fold_build2 (MINUS_EXPR, gfc_array_index_type,
gfc_conv_descriptor_ubound (dest, dest_index), gfc_conv_descriptor_ubound_get (dest, dest_index),
gfc_conv_descriptor_lbound (dest, dest_index)); gfc_conv_descriptor_lbound_get (dest, dest_index));
} }
} }
...@@ -850,12 +900,11 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr) ...@@ -850,12 +900,11 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr)
element is still at the same offset as before, except where the loop element is still at the same offset as before, except where the loop
starts at zero. */ starts at zero. */
if (!integer_zerop (loop->from[0])) if (!integer_zerop (loop->from[0]))
dest_info->offset = gfc_conv_descriptor_offset (src); dest_info->offset = gfc_conv_descriptor_offset_get (src);
else else
dest_info->offset = gfc_index_zero_node; dest_info->offset = gfc_index_zero_node;
gfc_add_modify (&se->pre, gfc_conv_descriptor_offset_set (&se->pre, dest,
gfc_conv_descriptor_offset (dest),
dest_info->offset); dest_info->offset);
if (dest_info->dimen > loop->temp_dim) if (dest_info->dimen > loop->temp_dim)
...@@ -894,11 +943,11 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra) ...@@ -894,11 +943,11 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra)
if (integer_zerop (extra)) if (integer_zerop (extra))
return; return;
ubound = gfc_conv_descriptor_ubound (desc, gfc_rank_cst[0]); ubound = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[0]);
/* Add EXTRA to the upper bound. */ /* Add EXTRA to the upper bound. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, ubound, extra); tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, ubound, extra);
gfc_add_modify (pblock, ubound, tmp); gfc_conv_descriptor_ubound_set (pblock, desc, gfc_rank_cst[0], tmp);
/* Get the value of the current data pointer. */ /* Get the value of the current data pointer. */
arg0 = gfc_conv_descriptor_data_get (desc); arg0 = gfc_conv_descriptor_data_get (desc);
...@@ -1877,7 +1926,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where) ...@@ -1877,7 +1926,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
/* If the array grows dynamically, the upper bound of the loop variable /* If the array grows dynamically, the upper bound of the loop variable
is determined by the array's final upper bound. */ is determined by the array's final upper bound. */
if (dynamic) if (dynamic)
loop->to[0] = gfc_conv_descriptor_ubound (desc, gfc_rank_cst[0]); loop->to[0] = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[0]);
if (TREE_USED (offsetvar)) if (TREE_USED (offsetvar))
pushdecl (offsetvar); pushdecl (offsetvar);
...@@ -1931,8 +1980,8 @@ gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info) ...@@ -1931,8 +1980,8 @@ gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info)
desc = info->subscript[dim]->data.info.descriptor; desc = info->subscript[dim]->data.info.descriptor;
zero = gfc_rank_cst[0]; zero = gfc_rank_cst[0];
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
gfc_conv_descriptor_ubound (desc, zero), gfc_conv_descriptor_ubound_get (desc, zero),
gfc_conv_descriptor_lbound (desc, zero)); gfc_conv_descriptor_lbound_get (desc, zero));
tmp = gfc_evaluate_now (tmp, &loop->pre); tmp = gfc_evaluate_now (tmp, &loop->pre);
loop->to[n] = tmp; loop->to[n] = tmp;
} }
...@@ -2160,7 +2209,7 @@ gfc_conv_array_offset (tree descriptor) ...@@ -2160,7 +2209,7 @@ gfc_conv_array_offset (tree descriptor)
if (GFC_ARRAY_TYPE_P (type)) if (GFC_ARRAY_TYPE_P (type))
return GFC_TYPE_ARRAY_OFFSET (type); return GFC_TYPE_ARRAY_OFFSET (type);
else else
return gfc_conv_descriptor_offset (descriptor); return gfc_conv_descriptor_offset_get (descriptor);
} }
...@@ -2179,7 +2228,7 @@ gfc_conv_array_stride (tree descriptor, int dim) ...@@ -2179,7 +2228,7 @@ gfc_conv_array_stride (tree descriptor, int dim)
if (tmp != NULL_TREE) if (tmp != NULL_TREE)
return tmp; return tmp;
tmp = gfc_conv_descriptor_stride (descriptor, gfc_rank_cst[dim]); tmp = gfc_conv_descriptor_stride_get (descriptor, gfc_rank_cst[dim]);
return tmp; return tmp;
} }
...@@ -2198,7 +2247,7 @@ gfc_conv_array_lbound (tree descriptor, int dim) ...@@ -2198,7 +2247,7 @@ gfc_conv_array_lbound (tree descriptor, int dim)
if (tmp != NULL_TREE) if (tmp != NULL_TREE)
return tmp; return tmp;
tmp = gfc_conv_descriptor_lbound (descriptor, gfc_rank_cst[dim]); tmp = gfc_conv_descriptor_lbound_get (descriptor, gfc_rank_cst[dim]);
return tmp; return tmp;
} }
...@@ -2222,7 +2271,7 @@ gfc_conv_array_ubound (tree descriptor, int dim) ...@@ -2222,7 +2271,7 @@ gfc_conv_array_ubound (tree descriptor, int dim)
if (GFC_ARRAY_TYPE_P (TREE_TYPE (descriptor))) if (GFC_ARRAY_TYPE_P (TREE_TYPE (descriptor)))
return gfc_index_zero_node; return gfc_index_zero_node;
tmp = gfc_conv_descriptor_ubound (descriptor, gfc_rank_cst[dim]); tmp = gfc_conv_descriptor_ubound_get (descriptor, gfc_rank_cst[dim]);
return tmp; return tmp;
} }
...@@ -3784,8 +3833,8 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, ...@@ -3784,8 +3833,8 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
ubound = lower[n]; ubound = lower[n];
} }
} }
tmp = gfc_conv_descriptor_lbound (descriptor, gfc_rank_cst[n]); gfc_conv_descriptor_lbound_set (pblock, descriptor, gfc_rank_cst[n],
gfc_add_modify (pblock, tmp, se.expr); se.expr);
/* Work out the offset for this component. */ /* Work out the offset for this component. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, se.expr, stride); tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, se.expr, stride);
...@@ -3801,12 +3850,10 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, ...@@ -3801,12 +3850,10 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
gfc_conv_expr_type (&se, ubound, gfc_array_index_type); gfc_conv_expr_type (&se, ubound, gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre); gfc_add_block_to_block (pblock, &se.pre);
tmp = gfc_conv_descriptor_ubound (descriptor, gfc_rank_cst[n]); gfc_conv_descriptor_ubound_set (pblock, descriptor, gfc_rank_cst[n], se.expr);
gfc_add_modify (pblock, tmp, se.expr);
/* Store the stride. */ /* Store the stride. */
tmp = gfc_conv_descriptor_stride (descriptor, gfc_rank_cst[n]); gfc_conv_descriptor_stride_set (pblock, descriptor, gfc_rank_cst[n], stride);
gfc_add_modify (pblock, tmp, stride);
/* Calculate the size of this dimension. */ /* Calculate the size of this dimension. */
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, se.expr, size); size = fold_build2 (PLUS_EXPR, gfc_array_index_type, se.expr, size);
...@@ -3935,8 +3982,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat) ...@@ -3935,8 +3982,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat)
tmp = fold_build2 (MODIFY_EXPR, void_type_node, pointer, tmp); tmp = fold_build2 (MODIFY_EXPR, void_type_node, pointer, tmp);
gfc_add_expr_to_block (&se->pre, tmp); gfc_add_expr_to_block (&se->pre, tmp);
tmp = gfc_conv_descriptor_offset (se->expr); gfc_conv_descriptor_offset_set (&se->pre, se->expr, offset);
gfc_add_modify (&se->pre, tmp, offset);
if (expr->ts.type == BT_DERIVED if (expr->ts.type == BT_DERIVED
&& expr->ts.derived->attr.alloc_comp) && expr->ts.derived->attr.alloc_comp)
...@@ -4426,7 +4472,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -4426,7 +4472,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
anything as we still don't know the array stride. */ anything as we still don't know the array stride. */
partial = gfc_create_var (boolean_type_node, "partial"); partial = gfc_create_var (boolean_type_node, "partial");
TREE_USED (partial) = 1; TREE_USED (partial) = 1;
tmp = gfc_conv_descriptor_stride (dumdesc, gfc_rank_cst[0]); tmp = gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[0]);
tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, gfc_index_one_node); tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, gfc_index_one_node);
gfc_add_modify (&block, partial, tmp); gfc_add_modify (&block, partial, tmp);
} }
...@@ -4440,7 +4486,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -4440,7 +4486,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
if (no_repack) if (no_repack)
{ {
/* Set the first stride. */ /* Set the first stride. */
stride = gfc_conv_descriptor_stride (dumdesc, gfc_rank_cst[0]); stride = gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[0]);
stride = gfc_evaluate_now (stride, &block); stride = gfc_evaluate_now (stride, &block);
tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp = fold_build2 (EQ_EXPR, boolean_type_node,
...@@ -4493,8 +4539,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -4493,8 +4539,8 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
if (checkparm || !sym->as->upper[n]) if (checkparm || !sym->as->upper[n])
{ {
/* Get the bounds of the actual parameter. */ /* Get the bounds of the actual parameter. */
dubound = gfc_conv_descriptor_ubound (dumdesc, gfc_rank_cst[n]); dubound = gfc_conv_descriptor_ubound_get (dumdesc, gfc_rank_cst[n]);
dlbound = gfc_conv_descriptor_lbound (dumdesc, gfc_rank_cst[n]); dlbound = gfc_conv_descriptor_lbound_get (dumdesc, gfc_rank_cst[n]);
} }
else else
{ {
...@@ -4564,7 +4610,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -4564,7 +4610,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
if (no_repack || partial != NULL_TREE) if (no_repack || partial != NULL_TREE)
{ {
stmt_unpacked = stmt_unpacked =
gfc_conv_descriptor_stride (dumdesc, gfc_rank_cst[n+1]); gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[n+1]);
} }
/* Figure out the stride if not a known constant. */ /* Figure out the stride if not a known constant. */
...@@ -5266,19 +5312,21 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -5266,19 +5312,21 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
to = fold_build2 (PLUS_EXPR, gfc_array_index_type, to, tmp); to = fold_build2 (PLUS_EXPR, gfc_array_index_type, to, tmp);
from = gfc_index_one_node; from = gfc_index_one_node;
} }
tmp = gfc_conv_descriptor_lbound (parm, gfc_rank_cst[dim]); gfc_conv_descriptor_lbound_set (&loop.pre, parm,
gfc_add_modify (&loop.pre, tmp, from); gfc_rank_cst[dim], from);
/* Set the new upper bound. */ /* Set the new upper bound. */
tmp = gfc_conv_descriptor_ubound (parm, gfc_rank_cst[dim]); gfc_conv_descriptor_ubound_set (&loop.pre, parm,
gfc_add_modify (&loop.pre, tmp, to); gfc_rank_cst[dim], to);
/* Multiply the stride by the section stride to get the /* Multiply the stride by the section stride to get the
total stride. */ total stride. */
stride = fold_build2 (MULT_EXPR, gfc_array_index_type, stride = fold_build2 (MULT_EXPR, gfc_array_index_type,
stride, info->stride[dim]); stride, info->stride[dim]);
if (se->direct_byref && info->ref && info->ref->u.ar.type != AR_FULL) if (se->direct_byref
&& info->ref
&& info->ref->u.ar.type != AR_FULL)
{ {
base = fold_build2 (MINUS_EXPR, TREE_TYPE (base), base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
base, stride); base, stride);
...@@ -5295,16 +5343,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -5295,16 +5343,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
} }
/* Store the new stride. */ /* Store the new stride. */
tmp = gfc_conv_descriptor_stride (parm, gfc_rank_cst[dim]); gfc_conv_descriptor_stride_set (&loop.pre, parm,
gfc_add_modify (&loop.pre, tmp, stride); gfc_rank_cst[dim], stride);
dim++; dim++;
} }
if (se->data_not_needed) if (se->data_not_needed)
gfc_conv_descriptor_data_set (&loop.pre, parm, gfc_index_zero_node); gfc_conv_descriptor_data_set (&loop.pre, parm,
gfc_index_zero_node);
else else
/* Point the data pointer at the first element in the section. */ /* Point the data pointer at the 1st element in the section. */
gfc_get_dataptr_offset (&loop.pre, parm, desc, offset, gfc_get_dataptr_offset (&loop.pre, parm, desc, offset,
subref_array_target, expr); subref_array_target, expr);
...@@ -5312,15 +5361,13 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -5312,15 +5361,13 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
&& !se->data_not_needed) && !se->data_not_needed)
{ {
/* Set the offset. */ /* Set the offset. */
tmp = gfc_conv_descriptor_offset (parm); gfc_conv_descriptor_offset_set (&loop.pre, parm, base);
gfc_add_modify (&loop.pre, tmp, base);
} }
else else
{ {
/* Only the callee knows what the correct offset it, so just set /* Only the callee knows what the correct offset it, so just set
it to zero here. */ it to zero here. */
tmp = gfc_conv_descriptor_offset (parm); gfc_conv_descriptor_offset_set (&loop.pre, parm, gfc_index_zero_node);
gfc_add_modify (&loop.pre, tmp, gfc_index_zero_node);
} }
desc = parm; desc = parm;
} }
...@@ -5355,8 +5402,8 @@ array_parameter_size (tree desc, gfc_expr *expr, tree *size) ...@@ -5355,8 +5402,8 @@ array_parameter_size (tree desc, gfc_expr *expr, tree *size)
gfc_build_addr_expr (NULL, desc)); gfc_build_addr_expr (NULL, desc));
else else
{ {
tree ubound = gfc_conv_descriptor_ubound (desc, gfc_index_zero_node); tree ubound = gfc_conv_descriptor_ubound_get (desc, gfc_index_zero_node);
tree lbound = gfc_conv_descriptor_lbound (desc, gfc_index_zero_node); tree lbound = gfc_conv_descriptor_lbound_get (desc, gfc_index_zero_node);
*size = fold_build2 (MINUS_EXPR, gfc_array_index_type, ubound, lbound); *size = fold_build2 (MINUS_EXPR, gfc_array_index_type, ubound, lbound);
*size = fold_build2 (PLUS_EXPR, gfc_array_index_type, *size, *size = fold_build2 (PLUS_EXPR, gfc_array_index_type, *size,
...@@ -5605,14 +5652,14 @@ get_full_array_size (stmtblock_t *block, tree decl, int rank) ...@@ -5605,14 +5652,14 @@ get_full_array_size (stmtblock_t *block, tree decl, int rank)
tree nelems; tree nelems;
tree tmp; tree tmp;
idx = gfc_rank_cst[rank - 1]; idx = gfc_rank_cst[rank - 1];
nelems = gfc_conv_descriptor_ubound (decl, idx); nelems = gfc_conv_descriptor_ubound_get (decl, idx);
tmp = gfc_conv_descriptor_lbound (decl, idx); tmp = gfc_conv_descriptor_lbound_get (decl, idx);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, nelems, tmp); tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, nelems, tmp);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
tmp, gfc_index_one_node); tmp, gfc_index_one_node);
tmp = gfc_evaluate_now (tmp, block); tmp = gfc_evaluate_now (tmp, block);
nelems = gfc_conv_descriptor_stride (decl, idx); nelems = gfc_conv_descriptor_stride_get (decl, idx);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, nelems, tmp); tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, nelems, tmp);
return gfc_evaluate_now (tmp, block); return gfc_evaluate_now (tmp, block);
} }
......
...@@ -120,13 +120,18 @@ tree gfc_conv_array_ubound (tree, int); ...@@ -120,13 +120,18 @@ tree gfc_conv_array_ubound (tree, int);
/* Build expressions for accessing components of an array descriptor. */ /* Build expressions for accessing components of an array descriptor. */
tree gfc_conv_descriptor_data_get (tree); tree gfc_conv_descriptor_data_get (tree);
void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree);
tree gfc_conv_descriptor_data_addr (tree); tree gfc_conv_descriptor_data_addr (tree);
tree gfc_conv_descriptor_offset (tree); tree gfc_conv_descriptor_offset_get (tree);
tree gfc_conv_descriptor_dtype (tree); tree gfc_conv_descriptor_dtype (tree);
tree gfc_conv_descriptor_stride (tree, tree); tree gfc_conv_descriptor_stride_get (tree, tree);
tree gfc_conv_descriptor_lbound (tree, tree); tree gfc_conv_descriptor_lbound_get (tree, tree);
tree gfc_conv_descriptor_ubound (tree, tree); tree gfc_conv_descriptor_ubound_get (tree, tree);
void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree);
void gfc_conv_descriptor_offset_set (stmtblock_t *, tree, tree);
void gfc_conv_descriptor_stride_set (stmtblock_t *, tree, tree, tree);
void gfc_conv_descriptor_lbound_set (stmtblock_t *, tree, tree, tree);
void gfc_conv_descriptor_ubound_set (stmtblock_t *, tree, tree, tree);
/* Add pre-loop scalarization code for intrinsic functions which require /* Add pre-loop scalarization code for intrinsic functions which require
special handling. */ special handling. */
......
...@@ -1628,15 +1628,15 @@ gfc_set_interface_mapping_bounds (stmtblock_t * block, tree type, tree desc) ...@@ -1628,15 +1628,15 @@ gfc_set_interface_mapping_bounds (stmtblock_t * block, tree type, tree desc)
if (GFC_TYPE_ARRAY_LBOUND (type, n) == NULL_TREE) if (GFC_TYPE_ARRAY_LBOUND (type, n) == NULL_TREE)
{ {
GFC_TYPE_ARRAY_LBOUND (type, n) GFC_TYPE_ARRAY_LBOUND (type, n)
= gfc_conv_descriptor_lbound (desc, dim); = gfc_conv_descriptor_lbound_get (desc, dim);
GFC_TYPE_ARRAY_UBOUND (type, n) GFC_TYPE_ARRAY_UBOUND (type, n)
= gfc_conv_descriptor_ubound (desc, dim); = gfc_conv_descriptor_ubound_get (desc, dim);
} }
else if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE) else if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE)
{ {
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
gfc_conv_descriptor_ubound (desc, dim), gfc_conv_descriptor_ubound_get (desc, dim),
gfc_conv_descriptor_lbound (desc, dim)); gfc_conv_descriptor_lbound_get (desc, dim));
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
GFC_TYPE_ARRAY_LBOUND (type, n), GFC_TYPE_ARRAY_LBOUND (type, n),
tmp); tmp);
...@@ -3620,7 +3620,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr) ...@@ -3620,7 +3620,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
/* Shift the lbound and ubound of temporaries to being unity, rather /* Shift the lbound and ubound of temporaries to being unity, rather
than zero, based. Calculate the offset for all cases. */ than zero, based. Calculate the offset for all cases. */
offset = gfc_conv_descriptor_offset (dest); offset = gfc_conv_descriptor_offset_get (dest);
gfc_add_modify (&block, offset, gfc_index_zero_node); gfc_add_modify (&block, offset, gfc_index_zero_node);
tmp2 =gfc_create_var (gfc_array_index_type, NULL); tmp2 =gfc_create_var (gfc_array_index_type, NULL);
for (n = 0; n < expr->rank; n++) for (n = 0; n < expr->rank; n++)
...@@ -3629,24 +3629,24 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr) ...@@ -3629,24 +3629,24 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
&& expr->expr_type != EXPR_CONSTANT) && expr->expr_type != EXPR_CONSTANT)
{ {
tree span; tree span;
tmp = gfc_conv_descriptor_ubound (dest, gfc_rank_cst[n]); tmp = gfc_conv_descriptor_ubound_get (dest, gfc_rank_cst[n]);
span = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp, span = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp,
gfc_conv_descriptor_lbound (dest, gfc_rank_cst[n])); gfc_conv_descriptor_lbound_get (dest, gfc_rank_cst[n]));
gfc_add_modify (&block, tmp, tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
fold_build2 (PLUS_EXPR, span, gfc_index_one_node);
gfc_array_index_type, gfc_conv_descriptor_ubound_set (&block, dest, gfc_rank_cst[n],
span, gfc_index_one_node)); tmp);
tmp = gfc_conv_descriptor_lbound (dest, gfc_rank_cst[n]); gfc_conv_descriptor_lbound_set (&block, dest, gfc_rank_cst[n],
gfc_add_modify (&block, tmp, gfc_index_one_node); gfc_index_one_node);
} }
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
gfc_conv_descriptor_lbound (dest, gfc_conv_descriptor_lbound_get (dest,
gfc_rank_cst[n]), gfc_rank_cst[n]),
gfc_conv_descriptor_stride (dest, gfc_conv_descriptor_stride_get (dest,
gfc_rank_cst[n])); gfc_rank_cst[n]));
gfc_add_modify (&block, tmp2, tmp); gfc_add_modify (&block, tmp2, tmp);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp2); tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp2);
gfc_add_modify (&block, offset, tmp); gfc_conv_descriptor_offset_set (&block, dest, tmp);
} }
if (expr->expr_type == EXPR_FUNCTION if (expr->expr_type == EXPR_FUNCTION
......
...@@ -899,8 +899,8 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -899,8 +899,8 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
} }
} }
ubound = gfc_conv_descriptor_ubound (desc, bound); ubound = gfc_conv_descriptor_ubound_get (desc, bound);
lbound = gfc_conv_descriptor_lbound (desc, bound); lbound = gfc_conv_descriptor_lbound_get (desc, bound);
/* Follow any component references. */ /* Follow any component references. */
if (arg->expr->expr_type == EXPR_VARIABLE if (arg->expr->expr_type == EXPR_VARIABLE
...@@ -962,7 +962,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) ...@@ -962,7 +962,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
if (as) if (as)
{ {
tree stride = gfc_conv_descriptor_stride (desc, bound); tree stride = gfc_conv_descriptor_stride_get (desc, bound);
cond1 = fold_build2 (GE_EXPR, boolean_type_node, ubound, lbound); cond1 = fold_build2 (GE_EXPR, boolean_type_node, ubound, lbound);
cond2 = fold_build2 (LE_EXPR, boolean_type_node, ubound, lbound); cond2 = fold_build2 (LE_EXPR, boolean_type_node, ubound, lbound);
...@@ -3476,8 +3476,8 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr) ...@@ -3476,8 +3476,8 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
tree ubound, lbound; tree ubound, lbound;
arg1 = build_fold_indirect_ref (arg1); arg1 = build_fold_indirect_ref (arg1);
ubound = gfc_conv_descriptor_ubound (arg1, argse.expr); ubound = gfc_conv_descriptor_ubound_get (arg1, argse.expr);
lbound = gfc_conv_descriptor_lbound (arg1, argse.expr); lbound = gfc_conv_descriptor_lbound_get (arg1, argse.expr);
se->expr = fold_build2 (MINUS_EXPR, gfc_array_index_type, se->expr = fold_build2 (MINUS_EXPR, gfc_array_index_type,
ubound, lbound); ubound, lbound);
se->expr = fold_build2 (PLUS_EXPR, gfc_array_index_type, se->expr, se->expr = fold_build2 (PLUS_EXPR, gfc_array_index_type, se->expr,
...@@ -3563,8 +3563,8 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr) ...@@ -3563,8 +3563,8 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
{ {
tree idx; tree idx;
idx = gfc_rank_cst[n]; idx = gfc_rank_cst[n];
lower = gfc_conv_descriptor_lbound (argse.expr, idx); lower = gfc_conv_descriptor_lbound_get (argse.expr, idx);
upper = gfc_conv_descriptor_ubound (argse.expr, idx); upper = gfc_conv_descriptor_ubound_get (argse.expr, idx);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
upper, lower); upper, lower);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
...@@ -3752,9 +3752,9 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) ...@@ -3752,9 +3752,9 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
tree idx; tree idx;
idx = gfc_rank_cst[n]; idx = gfc_rank_cst[n];
gfc_add_modify (&argse.pre, source_bytes, tmp); gfc_add_modify (&argse.pre, source_bytes, tmp);
stride = gfc_conv_descriptor_stride (argse.expr, idx); stride = gfc_conv_descriptor_stride_get (argse.expr, idx);
lower = gfc_conv_descriptor_lbound (argse.expr, idx); lower = gfc_conv_descriptor_lbound_get (argse.expr, idx);
upper = gfc_conv_descriptor_ubound (argse.expr, idx); upper = gfc_conv_descriptor_ubound_get (argse.expr, idx);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
upper, lower); upper, lower);
gfc_add_modify (&argse.pre, extent, tmp); gfc_add_modify (&argse.pre, extent, tmp);
...@@ -4070,7 +4070,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr) ...@@ -4070,7 +4070,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
present. */ present. */
arg1se.descriptor_only = 1; arg1se.descriptor_only = 1;
gfc_conv_expr_lhs (&arg1se, arg1->expr); gfc_conv_expr_lhs (&arg1se, arg1->expr);
tmp = gfc_conv_descriptor_stride (arg1se.expr, tmp = gfc_conv_descriptor_stride_get (arg1se.expr,
gfc_rank_cst[arg1->expr->rank - 1]); gfc_rank_cst[arg1->expr->rank - 1]);
nonzero_arraylen = fold_build2 (NE_EXPR, boolean_type_node, tmp, nonzero_arraylen = fold_build2 (NE_EXPR, boolean_type_node, tmp,
build_int_cst (TREE_TYPE (tmp), 0)); build_int_cst (TREE_TYPE (tmp), 0));
......
...@@ -150,14 +150,14 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer) ...@@ -150,14 +150,14 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
gfc_add_modify (&cond_block, decl, outer); gfc_add_modify (&cond_block, decl, outer);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1]; rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (decl, rank); size = gfc_conv_descriptor_ubound_get (decl, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size, size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_lbound (decl, rank)); gfc_conv_descriptor_lbound_get (decl, rank));
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size, size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size,
gfc_index_one_node); gfc_index_one_node);
if (GFC_TYPE_ARRAY_RANK (type) > 1) if (GFC_TYPE_ARRAY_RANK (type) > 1)
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_stride (decl, rank)); gfc_conv_descriptor_stride_get (decl, rank));
esize = fold_convert (gfc_array_index_type, esize = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (gfc_get_element_type (type))); TYPE_SIZE_UNIT (gfc_get_element_type (type)));
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize); size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize);
...@@ -202,14 +202,14 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src) ...@@ -202,14 +202,14 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
gfc_add_modify (&block, dest, src); gfc_add_modify (&block, dest, src);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1]; rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (dest, rank); size = gfc_conv_descriptor_ubound_get (dest, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size, size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_lbound (dest, rank)); gfc_conv_descriptor_lbound_get (dest, rank));
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size, size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size,
gfc_index_one_node); gfc_index_one_node);
if (GFC_TYPE_ARRAY_RANK (type) > 1) if (GFC_TYPE_ARRAY_RANK (type) > 1)
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_stride (dest, rank)); gfc_conv_descriptor_stride_get (dest, rank));
esize = fold_convert (gfc_array_index_type, esize = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (gfc_get_element_type (type))); TYPE_SIZE_UNIT (gfc_get_element_type (type)));
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize); size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize);
...@@ -243,14 +243,14 @@ gfc_omp_clause_assign_op (tree clause ATTRIBUTE_UNUSED, tree dest, tree src) ...@@ -243,14 +243,14 @@ gfc_omp_clause_assign_op (tree clause ATTRIBUTE_UNUSED, tree dest, tree src)
gfc_start_block (&block); gfc_start_block (&block);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1]; rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (dest, rank); size = gfc_conv_descriptor_ubound_get (dest, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size, size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_lbound (dest, rank)); gfc_conv_descriptor_lbound_get (dest, rank));
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size, size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size,
gfc_index_one_node); gfc_index_one_node);
if (GFC_TYPE_ARRAY_RANK (type) > 1) if (GFC_TYPE_ARRAY_RANK (type) > 1)
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_stride (dest, rank)); gfc_conv_descriptor_stride_get (dest, rank));
esize = fold_convert (gfc_array_index_type, esize = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (gfc_get_element_type (type))); TYPE_SIZE_UNIT (gfc_get_element_type (type)));
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize); size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize);
...@@ -606,14 +606,14 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) ...@@ -606,14 +606,14 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gfc_add_modify (&block, decl, outer_sym.backend_decl); gfc_add_modify (&block, decl, outer_sym.backend_decl);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1]; rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (decl, rank); size = gfc_conv_descriptor_ubound_get (decl, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size, size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_lbound (decl, rank)); gfc_conv_descriptor_lbound_get (decl, rank));
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size, size = fold_build2 (PLUS_EXPR, gfc_array_index_type, size,
gfc_index_one_node); gfc_index_one_node);
if (GFC_TYPE_ARRAY_RANK (type) > 1) if (GFC_TYPE_ARRAY_RANK (type) > 1)
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
gfc_conv_descriptor_stride (decl, rank)); gfc_conv_descriptor_stride_get (decl, rank));
esize = fold_convert (gfc_array_index_type, esize = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (gfc_get_element_type (type))); TYPE_SIZE_UNIT (gfc_get_element_type (type)));
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize); size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, esize);
......
...@@ -309,7 +309,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, ...@@ -309,7 +309,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
offset = gfc_index_zero_node; offset = gfc_index_zero_node;
for (n = 0; n < info->dimen; n++) for (n = 0; n < info->dimen; n++)
{ {
tmp = gfc_conv_descriptor_stride (info->descriptor, tmp = gfc_conv_descriptor_stride_get (info->descriptor,
gfc_rank_cst[n]); gfc_rank_cst[n]);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
loopse->loop->from[n], tmp); loopse->loop->from[n], tmp);
...@@ -1746,9 +1746,8 @@ forall_make_variable_temp (gfc_code *c, stmtblock_t *pre, stmtblock_t *post) ...@@ -1746,9 +1746,8 @@ forall_make_variable_temp (gfc_code *c, stmtblock_t *pre, stmtblock_t *post)
if (e->ts.type != BT_CHARACTER) if (e->ts.type != BT_CHARACTER)
{ {
/* Use the variable offset for the temporary. */ /* Use the variable offset for the temporary. */
tmp = gfc_conv_descriptor_offset (tse.expr); tmp = gfc_conv_array_offset (old_sym->backend_decl);
gfc_add_modify (pre, tmp, gfc_conv_descriptor_offset_set (pre, tse.expr, tmp);
gfc_conv_array_offset (old_sym->backend_decl));
} }
} }
else else
......
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