Commit 38611275 by Richard Guenther Committed by Richard Biener

trans.h (gfc_build_indirect_ref): Remove declaration.

2005-12-16  Richard Guenther  <rguenther@suse.de>

	* trans.h (gfc_build_indirect_ref): Remove declaration.
	* trans.c (gfc_build_indirect_ref): Remove.
	* trans-array.c (gfc_trans_array_ctor_element): Use
	build_fold_indirect_ref instead of gfc_build_indirect_ref.
	(gfc_trans_array_constructor_value): Likewise.
	(gfc_conv_array_index_offset): Likewise.
	(gfc_conv_scalarized_array_ref): Likewise.
	(gfc_conv_array_ref): Likewise.
	(gfc_trans_dummy_array_bias): Likewise.
	(gfc_conv_expr_descriptor): Likewise.
	(gfc_conv_array_parameter): Likewise.
	* trans-decl.c (gfc_finish_cray_pointee): Likewise.
	(gfc_get_symbol_decl): Likewise.
	* trans-expr.c (gfc_conv_substring): Likewise.
	(gfc_conv_component_ref): Likewise.
	(gfc_conv_variable): Likewise.
	(gfc_add_interface_mapping): Likewise.
	(gfc_conv_function_call): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_ichar): Likewise.
	(gfc_conv_intrinsic_transfer): Likewise.
	* trans-io.c (nml_get_addr_expr): Likewise.
	(transfer_namelist_element): Likewise.
	(transfer_expr): Likewise.
	* trans-stmt.c (gfc_trans_nested_forall_loop): Likewise.
	(allocate_temp_for_forall_nest_1): Likewise.
	(gfc_trans_forall_1): Likewise.

From-SVN: r108678
parent 06b11455
2005-12-16 Richard Guenther <rguenther@suse.de> 2005-12-16 Richard Guenther <rguenther@suse.de>
* trans.h (gfc_build_indirect_ref): Remove declaration.
* trans.c (gfc_build_indirect_ref): Remove.
* trans-array.c (gfc_trans_array_ctor_element): Use
build_fold_indirect_ref instead of gfc_build_indirect_ref.
(gfc_trans_array_constructor_value): Likewise.
(gfc_conv_array_index_offset): Likewise.
(gfc_conv_scalarized_array_ref): Likewise.
(gfc_conv_array_ref): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_expr_descriptor): Likewise.
(gfc_conv_array_parameter): Likewise.
* trans-decl.c (gfc_finish_cray_pointee): Likewise.
(gfc_get_symbol_decl): Likewise.
* trans-expr.c (gfc_conv_substring): Likewise.
(gfc_conv_component_ref): Likewise.
(gfc_conv_variable): Likewise.
(gfc_add_interface_mapping): Likewise.
(gfc_conv_function_call): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ichar): Likewise.
(gfc_conv_intrinsic_transfer): Likewise.
* trans-io.c (nml_get_addr_expr): Likewise.
(transfer_namelist_element): Likewise.
(transfer_expr): Likewise.
* trans-stmt.c (gfc_trans_nested_forall_loop): Likewise.
(allocate_temp_for_forall_nest_1): Likewise.
(gfc_trans_forall_1): Likewise.
2005-12-16 Richard Guenther <rguenther@suse.de>
* trans-array.c (gfc_conv_descriptor_data_addr): Use * trans-array.c (gfc_conv_descriptor_data_addr): Use
build_fold_addr_expr where appropriate. build_fold_addr_expr where appropriate.
(gfc_trans_allocate_array_storage): Likewise. (gfc_trans_allocate_array_storage): Likewise.
......
...@@ -932,7 +932,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc, ...@@ -932,7 +932,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
gfc_conv_expr (se, expr); gfc_conv_expr (se, expr);
/* Store the value. */ /* Store the value. */
tmp = gfc_build_indirect_ref (gfc_conv_descriptor_data_get (desc)); tmp = build_fold_indirect_ref (gfc_conv_descriptor_data_get (desc));
tmp = gfc_build_array_ref (tmp, offset); tmp = gfc_build_array_ref (tmp, offset);
if (expr->ts.type == BT_CHARACTER) if (expr->ts.type == BT_CHARACTER)
{ {
...@@ -1157,7 +1157,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, ...@@ -1157,7 +1157,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
/* Use BUILTIN_MEMCPY to assign the values. */ /* Use BUILTIN_MEMCPY to assign the values. */
tmp = gfc_conv_descriptor_data_get (desc); tmp = gfc_conv_descriptor_data_get (desc);
tmp = gfc_build_indirect_ref (tmp); tmp = build_fold_indirect_ref (tmp);
tmp = gfc_build_array_ref (tmp, *poffset); tmp = gfc_build_array_ref (tmp, *poffset);
tmp = build_fold_addr_expr (tmp); tmp = build_fold_addr_expr (tmp);
init = build_fold_addr_expr (init); init = build_fold_addr_expr (init);
...@@ -1827,7 +1827,7 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, ...@@ -1827,7 +1827,7 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
index, gfc_conv_array_stride (desc, 0)); index, gfc_conv_array_stride (desc, 0));
/* Read the vector to get an index into info->descriptor. */ /* Read the vector to get an index into info->descriptor. */
data = gfc_build_indirect_ref (gfc_conv_array_data (desc)); data = build_fold_indirect_ref (gfc_conv_array_data (desc));
index = gfc_build_array_ref (data, index); index = gfc_build_array_ref (data, index);
index = gfc_evaluate_now (index, &se->pre); index = gfc_evaluate_now (index, &se->pre);
...@@ -1891,7 +1891,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) ...@@ -1891,7 +1891,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar)
dimensions. */ dimensions. */
index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, info->offset); index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, info->offset);
tmp = gfc_build_indirect_ref (info->data); tmp = build_fold_indirect_ref (info->data);
se->expr = gfc_build_array_ref (tmp, index); se->expr = gfc_build_array_ref (tmp, index);
} }
...@@ -1980,7 +1980,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar) ...@@ -1980,7 +1980,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar)
/* Access the calculated element. */ /* Access the calculated element. */
tmp = gfc_conv_array_data (se->expr); tmp = gfc_conv_array_data (se->expr);
tmp = gfc_build_indirect_ref (tmp); tmp = build_fold_indirect_ref (tmp);
se->expr = gfc_build_array_ref (tmp, index); se->expr = gfc_build_array_ref (tmp, index);
} }
...@@ -3482,7 +3482,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3482,7 +3482,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
type = TREE_TYPE (tmpdesc); type = TREE_TYPE (tmpdesc);
gcc_assert (GFC_ARRAY_TYPE_P (type)); gcc_assert (GFC_ARRAY_TYPE_P (type));
dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc); dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
dumdesc = gfc_build_indirect_ref (dumdesc); dumdesc = build_fold_indirect_ref (dumdesc);
gfc_start_block (&block); gfc_start_block (&block);
if (sym->ts.type == BT_CHARACTER if (sym->ts.type == BT_CHARACTER
...@@ -3707,7 +3707,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) ...@@ -3707,7 +3707,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
stmt = gfc_finish_block (&cleanup); stmt = gfc_finish_block (&cleanup);
/* Only do the cleanup if the array was repacked. */ /* Only do the cleanup if the array was repacked. */
tmp = gfc_build_indirect_ref (dumdesc); tmp = build_fold_indirect_ref (dumdesc);
tmp = gfc_conv_descriptor_data_get (tmp); tmp = gfc_conv_descriptor_data_get (tmp);
tmp = build2 (NE_EXPR, boolean_type_node, tmp, tmpdesc); tmp = build2 (NE_EXPR, boolean_type_node, tmp, tmpdesc);
stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ());
...@@ -3961,7 +3961,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -3961,7 +3961,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
if (expr->ts.type == BT_CHARACTER) if (expr->ts.type == BT_CHARACTER)
{ {
gfc_conv_expr (&rse, expr); gfc_conv_expr (&rse, expr);
rse.expr = gfc_build_indirect_ref (rse.expr); rse.expr = build_fold_indirect_ref (rse.expr);
} }
else else
gfc_conv_expr_val (&rse, expr); gfc_conv_expr_val (&rse, expr);
...@@ -4119,7 +4119,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -4119,7 +4119,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Point the data pointer at the first element in the section. */ /* Point the data pointer at the first element in the section. */
tmp = gfc_conv_array_data (desc); tmp = gfc_conv_array_data (desc);
tmp = gfc_build_indirect_ref (tmp); tmp = build_fold_indirect_ref (tmp);
tmp = gfc_build_array_ref (tmp, offset); tmp = gfc_build_array_ref (tmp, offset);
offset = gfc_build_addr_expr (gfc_array_dataptr_type (desc), tmp); offset = gfc_build_addr_expr (gfc_array_dataptr_type (desc), tmp);
gfc_conv_descriptor_data_set (&loop.pre, parm, offset); gfc_conv_descriptor_data_set (&loop.pre, parm, offset);
...@@ -4228,7 +4228,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77) ...@@ -4228,7 +4228,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
gfc_init_block (&block); gfc_init_block (&block);
/* Only if it was repacked. This code needs to be executed before the /* Only if it was repacked. This code needs to be executed before the
loop cleanup code. */ loop cleanup code. */
tmp = gfc_build_indirect_ref (desc); tmp = build_fold_indirect_ref (desc);
tmp = gfc_conv_array_data (tmp); tmp = gfc_conv_array_data (tmp);
tmp = build2 (NE_EXPR, boolean_type_node, ptr, tmp); tmp = build2 (NE_EXPR, boolean_type_node, ptr, tmp);
tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ());
......
...@@ -368,7 +368,7 @@ gfc_finish_cray_pointee (tree decl, gfc_symbol *sym) ...@@ -368,7 +368,7 @@ gfc_finish_cray_pointee (tree decl, gfc_symbol *sym)
/* Parameters need to be dereferenced. */ /* Parameters need to be dereferenced. */
if (sym->cp_pointer->attr.dummy) if (sym->cp_pointer->attr.dummy)
ptr_decl = gfc_build_indirect_ref (ptr_decl); ptr_decl = build_fold_indirect_ref (ptr_decl);
/* Check to see if we're dealing with a variable-sized array. */ /* Check to see if we're dealing with a variable-sized array. */
if (sym->attr.dimension if (sym->attr.dimension
...@@ -382,7 +382,7 @@ gfc_finish_cray_pointee (tree decl, gfc_symbol *sym) ...@@ -382,7 +382,7 @@ gfc_finish_cray_pointee (tree decl, gfc_symbol *sym)
{ {
ptr_decl = convert (build_pointer_type (TREE_TYPE (decl)), ptr_decl = convert (build_pointer_type (TREE_TYPE (decl)),
ptr_decl); ptr_decl);
value = gfc_build_indirect_ref (ptr_decl); value = build_fold_indirect_ref (ptr_decl);
} }
SET_DECL_VALUE_EXPR (decl, value); SET_DECL_VALUE_EXPR (decl, value);
...@@ -856,7 +856,7 @@ gfc_get_symbol_decl (gfc_symbol * sym) ...@@ -856,7 +856,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
if (sym->attr.pointer && sym->attr.dummy if (sym->attr.pointer && sym->attr.dummy
&& sym->attr.dimension) && sym->attr.dimension)
{ {
tmp = gfc_build_indirect_ref (sym->backend_decl); tmp = build_fold_indirect_ref (sym->backend_decl);
etype = gfc_get_element_type (TREE_TYPE (tmp)); etype = gfc_get_element_type (TREE_TYPE (tmp));
if (TYPE_SIZE_UNIT (etype) == NULL_TREE) if (TYPE_SIZE_UNIT (etype) == NULL_TREE)
{ {
......
...@@ -232,7 +232,7 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind) ...@@ -232,7 +232,7 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
if (TYPE_STRING_FLAG (TREE_TYPE (se->expr))) if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
tmp = se->expr; tmp = se->expr;
else else
tmp = gfc_build_indirect_ref (se->expr); tmp = build_fold_indirect_ref (se->expr);
tmp = gfc_build_array_ref (tmp, start.expr); tmp = gfc_build_array_ref (tmp, start.expr);
se->expr = gfc_build_addr_expr (type, tmp); se->expr = gfc_build_addr_expr (type, tmp);
} }
...@@ -284,7 +284,7 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref) ...@@ -284,7 +284,7 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
} }
if (c->pointer && c->dimension == 0 && c->ts.type != BT_CHARACTER) if (c->pointer && c->dimension == 0 && c->ts.type != BT_CHARACTER)
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
} }
...@@ -372,19 +372,19 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -372,19 +372,19 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
&& (sym->attr.dummy && (sym->attr.dummy
|| sym->attr.function || sym->attr.function
|| sym->attr.result)) || sym->attr.result))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
} }
else else
{ {
/* Dereference non-character scalar dummy arguments. */ /* Dereference non-character scalar dummy arguments. */
if (sym->attr.dummy && !sym->attr.dimension) if (sym->attr.dummy && !sym->attr.dimension)
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
/* Dereference scalar hidden result. */ /* Dereference scalar hidden result. */
if (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX if (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX
&& (sym->attr.function || sym->attr.result) && (sym->attr.function || sym->attr.result)
&& !sym->attr.dimension && !sym->attr.pointer) && !sym->attr.dimension && !sym->attr.pointer)
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
/* Dereference non-character pointer variables. /* Dereference non-character pointer variables.
These must be dummies, results, or scalars. */ These must be dummies, results, or scalars. */
...@@ -393,7 +393,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -393,7 +393,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
|| sym->attr.function || sym->attr.function
|| sym->attr.result || sym->attr.result
|| !sym->attr.dimension)) || !sym->attr.dimension))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
} }
ref = expr->ref; ref = expr->ref;
...@@ -1291,12 +1291,12 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping, ...@@ -1291,12 +1291,12 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
value = fold_convert (tmp, se->expr); value = fold_convert (tmp, se->expr);
if (sym->attr.pointer) if (sym->attr.pointer)
value = gfc_build_indirect_ref (value); value = build_fold_indirect_ref (value);
} }
/* If the argument is a scalar or a pointer to an array, dereference it. */ /* If the argument is a scalar or a pointer to an array, dereference it. */
else if (!sym->attr.dimension || sym->attr.pointer) else if (!sym->attr.dimension || sym->attr.pointer)
value = gfc_build_indirect_ref (se->expr); value = build_fold_indirect_ref (se->expr);
/* If the argument is an array descriptor, use it to determine /* If the argument is an array descriptor, use it to determine
information about the actual argument's shape. */ information about the actual argument's shape. */
...@@ -1304,7 +1304,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping, ...@@ -1304,7 +1304,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
&& GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (se->expr)))) && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (se->expr))))
{ {
/* Get the actual argument's descriptor. */ /* Get the actual argument's descriptor. */
desc = gfc_build_indirect_ref (se->expr); desc = build_fold_indirect_ref (se->expr);
/* Create the replacement variable. */ /* Create the replacement variable. */
tmp = gfc_conv_descriptor_data_get (desc); tmp = gfc_conv_descriptor_data_get (desc);
...@@ -1748,7 +1748,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1748,7 +1748,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
x = f() x = f()
where f is pointer valued, we have to dereference the result. */ where f is pointer valued, we have to dereference the result. */
if (!se->want_pointer && !byref && sym->attr.pointer) if (!se->want_pointer && !byref && sym->attr.pointer)
se->expr = gfc_build_indirect_ref (se->expr); se->expr = build_fold_indirect_ref (se->expr);
/* f2c calling conventions require a scalar default real function to /* f2c calling conventions require a scalar default real function to
return a double precision result. Convert this back to default return a double precision result. Convert this back to default
...@@ -1793,7 +1793,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1793,7 +1793,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
{ {
/* Dereference for character pointer results. */ /* Dereference for character pointer results. */
if (sym->attr.pointer || sym->attr.allocatable) if (sym->attr.pointer || sym->attr.allocatable)
se->expr = gfc_build_indirect_ref (var); se->expr = build_fold_indirect_ref (var);
else else
se->expr = var; se->expr = var;
...@@ -1802,7 +1802,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1802,7 +1802,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
else else
{ {
gcc_assert (sym->ts.type == BT_COMPLEX && gfc_option.flag_f2c); gcc_assert (sym->ts.type == BT_COMPLEX && gfc_option.flag_f2c);
se->expr = gfc_build_indirect_ref (var); se->expr = build_fold_indirect_ref (var);
} }
} }
} }
......
...@@ -2177,7 +2177,7 @@ gfc_conv_intrinsic_ichar (gfc_se * se, gfc_expr * expr) ...@@ -2177,7 +2177,7 @@ gfc_conv_intrinsic_ichar (gfc_se * se, gfc_expr * expr)
arg = build1 (NOP_EXPR, pchar_type_node, arg); arg = build1 (NOP_EXPR, pchar_type_node, arg);
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
se->expr = gfc_build_indirect_ref (arg); se->expr = build_fold_indirect_ref (arg);
se->expr = convert (type, se->expr); se->expr = convert (type, se->expr);
} }
...@@ -2341,7 +2341,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) ...@@ -2341,7 +2341,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
} }
else else
{ {
se->expr = gfc_build_indirect_ref (ptr); se->expr = build_fold_indirect_ref (ptr);
} }
} }
......
...@@ -1164,7 +1164,7 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c, ...@@ -1164,7 +1164,7 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
dummy_arg_flagged = POINTER_TYPE_P (TREE_TYPE(tmp)); dummy_arg_flagged = POINTER_TYPE_P (TREE_TYPE(tmp));
itmp = (dummy_arg_flagged) ? gfc_build_indirect_ref (tmp) : tmp; itmp = (dummy_arg_flagged) ? build_fold_indirect_ref (tmp) : tmp;
/* If an array, set flag and use indirect ref. if built. */ /* If an array, set flag and use indirect ref. if built. */
...@@ -1196,7 +1196,7 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c, ...@@ -1196,7 +1196,7 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
/* If scalar dummy, resolve indirect reference now. */ /* If scalar dummy, resolve indirect reference now. */
if (dummy_arg_flagged && !array_flagged) if (dummy_arg_flagged && !array_flagged)
tmp = gfc_build_indirect_ref (tmp); tmp = build_fold_indirect_ref (tmp);
gcc_assert (tmp && POINTER_TYPE_P (TREE_TYPE (tmp))); gcc_assert (tmp && POINTER_TYPE_P (TREE_TYPE (tmp)));
...@@ -1322,7 +1322,7 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name, ...@@ -1322,7 +1322,7 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
/* Provide the RECORD_TYPE to build component references. */ /* Provide the RECORD_TYPE to build component references. */
tree expr = gfc_build_indirect_ref (addr_expr); tree expr = build_fold_indirect_ref (addr_expr);
for (cmp = ts->derived->components; cmp; cmp = cmp->next) for (cmp = ts->derived->components; cmp; cmp = cmp->next)
{ {
...@@ -1692,7 +1692,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) ...@@ -1692,7 +1692,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
arg2 = se->string_length; arg2 = se->string_length;
else else
{ {
tmp = gfc_build_indirect_ref (addr_expr); tmp = build_fold_indirect_ref (addr_expr);
gcc_assert (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE);
arg2 = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp))); arg2 = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp)));
} }
...@@ -1702,7 +1702,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr) ...@@ -1702,7 +1702,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
case BT_DERIVED: case BT_DERIVED:
/* Recurse into the elements of the derived type. */ /* Recurse into the elements of the derived type. */
expr = gfc_evaluate_now (addr_expr, &se->pre); expr = gfc_evaluate_now (addr_expr, &se->pre);
expr = gfc_build_indirect_ref (expr); expr = build_fold_indirect_ref (expr);
for (c = ts->derived->components; c; c = c->next) for (c = ts->derived->components; c; c = c->next)
{ {
......
...@@ -1471,7 +1471,7 @@ gfc_trans_nested_forall_loop (forall_info * nested_forall_info, tree body, ...@@ -1471,7 +1471,7 @@ gfc_trans_nested_forall_loop (forall_info * nested_forall_info, tree body,
{ {
/* If a mask was specified make the assignment conditional. */ /* If a mask was specified make the assignment conditional. */
if (pmask) if (pmask)
tmp = gfc_build_indirect_ref (mask); tmp = build_fold_indirect_ref (mask);
else else
tmp = mask; tmp = mask;
tmp = gfc_build_array_ref (tmp, maskindex); tmp = gfc_build_array_ref (tmp, maskindex);
...@@ -1890,7 +1890,7 @@ allocate_temp_for_forall_nest_1 (tree type, tree size, stmtblock_t * block, ...@@ -1890,7 +1890,7 @@ allocate_temp_for_forall_nest_1 (tree type, tree size, stmtblock_t * block,
temp1 = gfc_do_allocate (bytesize, size, ptemp1, block, type); temp1 = gfc_do_allocate (bytesize, size, ptemp1, block, type);
if (*ptemp1) if (*ptemp1)
tmp = gfc_build_indirect_ref (temp1); tmp = build_fold_indirect_ref (temp1);
else else
tmp = temp1; tmp = temp1;
...@@ -2404,7 +2404,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) ...@@ -2404,7 +2404,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
se.expr = convert (smallest_boolean_type_node, se.expr); se.expr = convert (smallest_boolean_type_node, se.expr);
if (pmask) if (pmask)
tmp = gfc_build_indirect_ref (mask); tmp = build_fold_indirect_ref (mask);
else else
tmp = mask; tmp = mask;
tmp = gfc_build_array_ref (tmp, maskindex); tmp = gfc_build_array_ref (tmp, maskindex);
......
...@@ -282,22 +282,6 @@ gfc_build_addr_expr (tree type, tree t) ...@@ -282,22 +282,6 @@ gfc_build_addr_expr (tree type, tree t)
} }
/* Build an INDIRECT_REF with its natural type. */
tree
gfc_build_indirect_ref (tree t)
{
tree type = TREE_TYPE (t);
gcc_assert (POINTER_TYPE_P (type));
type = TREE_TYPE (type);
if (TREE_CODE (t) == ADDR_EXPR)
return TREE_OPERAND (t, 0);
else
return build1 (INDIRECT_REF, type, t);
}
/* Build an ARRAY_REF with its natural type. */ /* Build an ARRAY_REF with its natural type. */
tree tree
......
...@@ -351,9 +351,6 @@ tree gfc_build_function_call (tree, tree); ...@@ -351,9 +351,6 @@ tree gfc_build_function_call (tree, tree);
/* Build an ADDR_EXPR. */ /* Build an ADDR_EXPR. */
tree gfc_build_addr_expr (tree, tree); tree gfc_build_addr_expr (tree, tree);
/* Build an INDIRECT_REF. */
tree gfc_build_indirect_ref (tree);
/* Build an ARRAY_REF. */ /* Build an ARRAY_REF. */
tree gfc_build_array_ref (tree, tree); tree gfc_build_array_ref (tree, tree);
......
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