Commit 10c7a96f by Steven Bosscher Committed by Steven Bosscher

convert.c (convert): Replace fold (buildN (...)) with fold_buildN.

	* convert.c (convert): Replace fold (buildN (...)) with fold_buildN.
	* trans-array.c (gfc_trans_allocate_array_storage,
	gfc_trans_allocate_temp_array gfc_trans_array_constructor_value,
	gfc_conv_array_index_ref, gfc_trans_array_bound_check,
	gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
	gfc_conv_array_ref, gfc_trans_preloop_setup, gfc_conv_ss_startstride,
	gfc_conv_loop_setup, gfc_array_init_size, gfc_trans_array_bounds,
	gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
	gfc_conv_expr_descriptor): Likewise.
	* trans-expr.c (gfc_conv_powi, gfc_conv_string_tmp,
	gfc_conv_concat_op, gfc_conv_expr_op): Likewise.
	* trans-intrinsic.c (build_round_expr, gfc_conv_intrinsic_bound,
	gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_sign,
	gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval,
	gfc_conv_intrinsic_btest, gfc_conv_intrinsic_bitop,
	gfc_conv_intrinsic_singlebitop, gfc_conv_intrinsic_ibits,
	gfc_conv_intrinsic_ishft, gfc_conv_intrinsic_ishftc,
	gfc_conv_intrinsic_merge, prepare_arg_info,
	gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_repeat): Likewise.
	* trans-stmt.c (gfc_trans_simple_do, gfc_trans_do, gfc_trans_do_while,
	gfc_trans_forall_loop, gfc_do_allocate, generate_loop_for_temp_to_lhs,
	generate_loop_for_rhs_to_temp, compute_inner_temp_size,
	allocate_temp_for_forall_nest, gfc_trans_pointer_assign_need_temp,
	gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_where_assign):
	Likewise.
	* trans-types.c (gfc_get_dtype, gfc_get_array_type_bounds): Likewise.
	* trans.c (gfc_add_modify_expr): Likewise.

From-SVN: r96926
parent 2bc3f466
2005-03-23 Steven Bosscher <stevenb@suse.de>
* convert.c (convert): Replace fold (buildN (...)) with fold_buildN.
* trans-array.c (gfc_trans_allocate_array_storage,
gfc_trans_allocate_temp_array gfc_trans_array_constructor_value,
gfc_conv_array_index_ref, gfc_trans_array_bound_check,
gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
gfc_conv_array_ref, gfc_trans_preloop_setup, gfc_conv_ss_startstride,
gfc_conv_loop_setup, gfc_array_init_size, gfc_trans_array_bounds,
gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
gfc_conv_expr_descriptor): Likewise.
* trans-expr.c (gfc_conv_powi, gfc_conv_string_tmp,
gfc_conv_concat_op, gfc_conv_expr_op): Likewise.
* trans-intrinsic.c (build_round_expr, gfc_conv_intrinsic_bound,
gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_sign,
gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval,
gfc_conv_intrinsic_btest, gfc_conv_intrinsic_bitop,
gfc_conv_intrinsic_singlebitop, gfc_conv_intrinsic_ibits,
gfc_conv_intrinsic_ishft, gfc_conv_intrinsic_ishftc,
gfc_conv_intrinsic_merge, prepare_arg_info,
gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_repeat): Likewise.
* trans-stmt.c (gfc_trans_simple_do, gfc_trans_do, gfc_trans_do_while,
gfc_trans_forall_loop, gfc_do_allocate, generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, compute_inner_temp_size,
allocate_temp_for_forall_nest, gfc_trans_pointer_assign_need_temp,
gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_where_assign):
Likewise.
* trans-types.c (gfc_get_dtype, gfc_get_array_type_bounds): Likewise.
* trans.c (gfc_add_modify_expr): Likewise.
2005-03-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
......
......@@ -81,7 +81,7 @@ convert (tree type, tree expr)
return expr;
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
return fold (build1 (NOP_EXPR, type, expr));
return fold_build1 (NOP_EXPR, type, expr);
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
......@@ -106,9 +106,9 @@ convert (tree type, tree expr)
/* If we have a NOP_EXPR, we must fold it here to avoid
infinite recursion between fold () and convert (). */
if (TREE_CODE (e) == NOP_EXPR)
return fold (build1 (NOP_EXPR, type, TREE_OPERAND (e, 0)));
return fold_build1 (NOP_EXPR, type, TREE_OPERAND (e, 0));
else
return fold (build1 (NOP_EXPR, type, e));
return fold_build1 (NOP_EXPR, type, e);
}
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
return fold (convert_to_pointer (type, e));
......
......@@ -513,7 +513,7 @@ gfc_conv_powi (gfc_se * se, int n, tree * tmpvar)
op1 = op0;
}
tmp = fold (build2 (MULT_EXPR, TREE_TYPE (op0), op0, op1));
tmp = fold_build2 (MULT_EXPR, TREE_TYPE (op0), op0, op1);
tmp = gfc_evaluate_now (tmp, &se->pre);
if (n < POWI_TABLE_SIZE)
......@@ -738,9 +738,8 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
if (gfc_can_put_var_on_stack (len))
{
/* Create a temporary variable to hold the result. */
tmp = fold (build2 (MINUS_EXPR, gfc_charlen_type_node, len,
convert (gfc_charlen_type_node,
integer_one_node)));
tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len,
convert (gfc_charlen_type_node, integer_one_node));
tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp);
tmp = build_array_type (gfc_character1_type_node, tmp);
var = gfc_create_var (tmp, "str");
......@@ -797,8 +796,8 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
len = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
if (len == NULL_TREE)
{
len = fold (build2 (PLUS_EXPR, TREE_TYPE (lse.string_length),
lse.string_length, rse.string_length));
len = fold_build2 (PLUS_EXPR, TREE_TYPE (lse.string_length),
lse.string_length, rse.string_length);
}
type = build_pointer_type (type);
......@@ -990,11 +989,11 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
if (lop)
{
/* The result of logical ops is always boolean_type_node. */
tmp = fold (build2 (code, type, lse.expr, rse.expr));
tmp = fold_build2 (code, type, lse.expr, rse.expr);
se->expr = convert (type, tmp);
}
else
se->expr = fold (build2 (code, type, lse.expr, rse.expr));
se->expr = fold_build2 (code, type, lse.expr, rse.expr);
/* Add the post blocks. */
gfc_add_block_to_block (&se->post, &rse.post);
......
......@@ -926,8 +926,8 @@ gfc_get_dtype (tree type)
if (size && !INTEGER_CST_P (size))
{
tmp = build_int_cst (gfc_array_index_type, GFC_DTYPE_SIZE_SHIFT);
tmp = fold (build2 (LSHIFT_EXPR, gfc_array_index_type, size, tmp));
dtype = fold (build2 (PLUS_EXPR, gfc_array_index_type, tmp, dtype));
tmp = fold_build2 (LSHIFT_EXPR, gfc_array_index_type, size, tmp);
dtype = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, dtype);
}
/* If we don't know the size we leave it as zero. This should never happen
for anything that is actually used. */
......@@ -1160,11 +1160,11 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound,
if (upper != NULL_TREE && lower != NULL_TREE && stride != NULL_TREE)
{
tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, upper, lower));
tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, tmp,
gfc_index_one_node));
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, upper, lower);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp,
gfc_index_one_node);
stride =
fold (build2 (MULT_EXPR, gfc_array_index_type, tmp, stride));
fold_build2 (MULT_EXPR, gfc_array_index_type, tmp, stride);
/* Check the folding worked. */
gcc_assert (INTEGER_CST_P (stride));
}
......
......@@ -152,7 +152,7 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs)
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs));
tmp = fold_build2 (MODIFY_EXPR, void_type_node, lhs, rhs);
gfc_add_expr_to_block (pblock, tmp);
}
......
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