Commit b4257cfc by Richard Guenther Committed by Richard Biener

tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.

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

	* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
	* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
	Likewise.
	* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
	maybe_fold_offset_to_component_ref): Likewise.
	* tree-ssa-dom.c (thread_across_edge,
	simplify_rhs_and_lookup_avail_expr,
	find_equivalent_equality_comparison, record_equivalences_from_stmt):
	Likewise.
	* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
	* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
	lower_try_finally_switch): Likewise.
	* tree-if-conv.c (add_to_dst_predicate_list,
	replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
	* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
	voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
	gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
	gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
	shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
	gimplify_init_ctor_eval, gimplify_init_constructor,
	gimplify_variable_sized_compare, gimplify_boolean_expr,
	gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
	gimplify_expr, gimplify_body, gimplify_function_tree,
	force_gimple_operand): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
	* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
	mx_register_decls): Likewise.
	* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
	get_frame_field, finalize_nesting_tree_1): Likewise.
	* tree-inline.c (setup_one_parameter): Likewise.
	* tree-vect-transform.c (vectorizable_condition): Likewise.
	* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
	Likewise.
	* tree-profile.c (tree_gen_edge_profiler): Likewise.
	* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
	* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.

From-SVN: r107907
parent 47a25a46
2005-12-02 Richard Guenther <rguenther@suse.de> 2005-12-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
Likewise.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
maybe_fold_offset_to_component_ref): Likewise.
* tree-ssa-dom.c (thread_across_edge,
simplify_rhs_and_lookup_avail_expr,
find_equivalent_equality_comparison, record_equivalences_from_stmt):
Likewise.
* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
lower_try_finally_switch): Likewise.
* tree-if-conv.c (add_to_dst_predicate_list,
replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
gimplify_init_ctor_eval, gimplify_init_constructor,
gimplify_variable_sized_compare, gimplify_boolean_expr,
gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
gimplify_expr, gimplify_body, gimplify_function_tree,
force_gimple_operand): Likewise.
* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
mx_register_decls): Likewise.
* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
get_frame_field, finalize_nesting_tree_1): Likewise.
* tree-inline.c (setup_one_parameter): Likewise.
* tree-vect-transform.c (vectorizable_condition): Likewise.
* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
Likewise.
* tree-profile.c (tree_gen_edge_profiler): Likewise.
* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
* tree-chrec.h (build_polynomial_chrec): Likewise.
2005-12-02 Richard Guenther <rguenther@suse.de>
* config/alpha/alpha.c (alpha_va_start, alpha_gimplify_va_arg_1i, * config/alpha/alpha.c (alpha_va_start, alpha_gimplify_va_arg_1i,
alpha_gimplify_va_arg): Use buildN and fold_buildN where applicable. alpha_gimplify_va_arg): Use buildN and fold_buildN where applicable.
* config/frv/frv.c (frv_expand_builtin_va_start): Likewise. * config/frv/frv.c (frv_expand_builtin_va_start): Likewise.
......
...@@ -3629,7 +3629,7 @@ c_parser_if_body (c_parser *parser, bool *if_p) ...@@ -3629,7 +3629,7 @@ c_parser_if_body (c_parser *parser, bool *if_p)
c_parser_label (parser); c_parser_label (parser);
*if_p = c_parser_next_token_is_keyword (parser, RID_IF); *if_p = c_parser_next_token_is_keyword (parser, RID_IF);
if (extra_warnings && c_parser_next_token_is (parser, CPP_SEMICOLON)) if (extra_warnings && c_parser_next_token_is (parser, CPP_SEMICOLON))
add_stmt (build (NOP_EXPR, NULL_TREE, NULL_TREE)); add_stmt (build1 (NOP_EXPR, NULL_TREE, NULL_TREE));
c_parser_statement_after_labels (parser); c_parser_statement_after_labels (parser);
return c_end_compound_stmt (block, flag_isoc99); return c_end_compound_stmt (block, flag_isoc99);
} }
...@@ -3692,7 +3692,7 @@ c_parser_switch_statement (c_parser *parser) ...@@ -3692,7 +3692,7 @@ c_parser_switch_statement (c_parser *parser)
body = c_parser_c99_block_statement (parser); body = c_parser_c99_block_statement (parser);
c_finish_case (body); c_finish_case (body);
if (c_break_label) if (c_break_label)
add_stmt (build (LABEL_EXPR, void_type_node, c_break_label)); add_stmt (build1 (LABEL_EXPR, void_type_node, c_break_label));
c_break_label = save_break; c_break_label = save_break;
add_stmt (c_end_compound_stmt (block, flag_isoc99)); add_stmt (c_end_compound_stmt (block, flag_isoc99));
} }
......
...@@ -91,7 +91,7 @@ lower_function_body (void) ...@@ -91,7 +91,7 @@ lower_function_body (void)
&& (data.return_statements == NULL && (data.return_statements == NULL
|| TREE_OPERAND (TREE_VALUE (data.return_statements), 0) != NULL)) || TREE_OPERAND (TREE_VALUE (data.return_statements), 0) != NULL))
{ {
x = build (RETURN_EXPR, void_type_node, NULL); x = build1 (RETURN_EXPR, void_type_node, NULL);
SET_EXPR_LOCATION (x, cfun->function_end_locus); SET_EXPR_LOCATION (x, cfun->function_end_locus);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING); tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
} }
...@@ -100,7 +100,7 @@ lower_function_body (void) ...@@ -100,7 +100,7 @@ lower_function_body (void)
at the end of the function. */ at the end of the function. */
for (t = data.return_statements ; t ; t = TREE_CHAIN (t)) for (t = data.return_statements ; t ; t = TREE_CHAIN (t))
{ {
x = build (LABEL_EXPR, void_type_node, TREE_PURPOSE (t)); x = build1 (LABEL_EXPR, void_type_node, TREE_PURPOSE (t));
tsi_link_after (&i, x, TSI_CONTINUE_LINKING); tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
/* Remove the line number from the representative return statement. /* Remove the line number from the representative return statement.
...@@ -503,7 +503,7 @@ lower_return_expr (tree_stmt_iterator *tsi, struct lower_data *data) ...@@ -503,7 +503,7 @@ lower_return_expr (tree_stmt_iterator *tsi, struct lower_data *data)
/* Generate a goto statement and remove the return statement. */ /* Generate a goto statement and remove the return statement. */
found: found:
t = build (GOTO_EXPR, void_type_node, label); t = build1 (GOTO_EXPR, void_type_node, label);
SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt)); SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
tsi_link_before (tsi, t, TSI_SAME_STMT); tsi_link_before (tsi, t, TSI_SAME_STMT);
tsi_delink (tsi); tsi_delink (tsi);
......
...@@ -533,7 +533,7 @@ internal_get_tmp_var (tree val, tree *pre_p, tree *post_p, bool is_formal) ...@@ -533,7 +533,7 @@ internal_get_tmp_var (tree val, tree *pre_p, tree *post_p, bool is_formal)
if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE) if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE)
DECL_COMPLEX_GIMPLE_REG_P (t) = 1; DECL_COMPLEX_GIMPLE_REG_P (t) = 1;
mod = build (MODIFY_EXPR, TREE_TYPE (t), t, val); mod = build2 (MODIFY_EXPR, TREE_TYPE (t), t, val);
if (EXPR_HAS_LOCATION (val)) if (EXPR_HAS_LOCATION (val))
SET_EXPR_LOCUS (mod, EXPR_LOCUS (val)); SET_EXPR_LOCUS (mod, EXPR_LOCUS (val));
...@@ -796,10 +796,10 @@ gimple_build_eh_filter (tree body, tree allowed, tree failure) ...@@ -796,10 +796,10 @@ gimple_build_eh_filter (tree body, tree allowed, tree failure)
tree t; tree t;
/* FIXME should the allowed types go in TREE_TYPE? */ /* FIXME should the allowed types go in TREE_TYPE? */
t = build (EH_FILTER_EXPR, void_type_node, allowed, NULL_TREE); t = build2 (EH_FILTER_EXPR, void_type_node, allowed, NULL_TREE);
append_to_statement_list (failure, &EH_FILTER_FAILURE (t)); append_to_statement_list (failure, &EH_FILTER_FAILURE (t));
t = build (TRY_CATCH_EXPR, void_type_node, NULL_TREE, t); t = build2 (TRY_CATCH_EXPR, void_type_node, NULL_TREE, t);
append_to_statement_list (body, &TREE_OPERAND (t, 0)); append_to_statement_list (body, &TREE_OPERAND (t, 0));
return t; return t;
...@@ -866,7 +866,7 @@ voidify_wrapper_expr (tree wrapper, tree temp) ...@@ -866,7 +866,7 @@ voidify_wrapper_expr (tree wrapper, tree temp)
{ {
tree ptr = TREE_OPERAND (*p, 0); tree ptr = TREE_OPERAND (*p, 0);
temp = create_tmp_var (TREE_TYPE (ptr), "retval"); temp = create_tmp_var (TREE_TYPE (ptr), "retval");
*p = build (MODIFY_EXPR, TREE_TYPE (ptr), temp, ptr); *p = build2 (MODIFY_EXPR, TREE_TYPE (ptr), temp, ptr);
temp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (temp)), temp); temp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (temp)), temp);
/* If this is a BIND_EXPR for a const inline function, it might not /* If this is a BIND_EXPR for a const inline function, it might not
have TREE_SIDE_EFFECTS set. That is no longer accurate. */ have TREE_SIDE_EFFECTS set. That is no longer accurate. */
...@@ -876,7 +876,7 @@ voidify_wrapper_expr (tree wrapper, tree temp) ...@@ -876,7 +876,7 @@ voidify_wrapper_expr (tree wrapper, tree temp)
{ {
if (!temp) if (!temp)
temp = create_tmp_var (TREE_TYPE (wrapper), "retval"); temp = create_tmp_var (TREE_TYPE (wrapper), "retval");
*p = build (MODIFY_EXPR, TREE_TYPE (temp), temp, *p); *p = build2 (MODIFY_EXPR, TREE_TYPE (temp), temp, *p);
TREE_SIDE_EFFECTS (wrapper) = 1; TREE_SIDE_EFFECTS (wrapper) = 1;
} }
...@@ -900,7 +900,7 @@ build_stack_save_restore (tree *save, tree *restore) ...@@ -900,7 +900,7 @@ build_stack_save_restore (tree *save, tree *restore)
NULL_TREE); NULL_TREE);
tmp_var = create_tmp_var (ptr_type_node, "saved_stack"); tmp_var = create_tmp_var (ptr_type_node, "saved_stack");
*save = build (MODIFY_EXPR, ptr_type_node, tmp_var, save_call); *save = build2 (MODIFY_EXPR, ptr_type_node, tmp_var, save_call);
*restore = *restore =
build_function_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE], build_function_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
tree_cons (NULL_TREE, tmp_var, NULL_TREE)); tree_cons (NULL_TREE, tmp_var, NULL_TREE));
...@@ -947,7 +947,7 @@ gimplify_bind_expr (tree *expr_p, tree temp, tree *pre_p) ...@@ -947,7 +947,7 @@ gimplify_bind_expr (tree *expr_p, tree temp, tree *pre_p)
format of the emitted code: see mx_register_decls(). */ format of the emitted code: see mx_register_decls(). */
build_stack_save_restore (&stack_save, &stack_restore); build_stack_save_restore (&stack_save, &stack_restore);
t = build (TRY_FINALLY_EXPR, void_type_node, t = build2 (TRY_FINALLY_EXPR, void_type_node,
BIND_EXPR_BODY (bind_expr), NULL_TREE); BIND_EXPR_BODY (bind_expr), NULL_TREE);
append_to_statement_list (stack_restore, &TREE_OPERAND (t, 1)); append_to_statement_list (stack_restore, &TREE_OPERAND (t, 1));
...@@ -1038,7 +1038,7 @@ gimplify_return_expr (tree stmt, tree *pre_p) ...@@ -1038,7 +1038,7 @@ gimplify_return_expr (tree stmt, tree *pre_p)
if (result == result_decl) if (result == result_decl)
ret_expr = result; ret_expr = result;
else else
ret_expr = build (MODIFY_EXPR, TREE_TYPE (result), result_decl, result); ret_expr = build2 (MODIFY_EXPR, TREE_TYPE (result), result_decl, result);
TREE_OPERAND (stmt, 0) = ret_expr; TREE_OPERAND (stmt, 0) = ret_expr;
return GS_ALL_DONE; return GS_ALL_DONE;
...@@ -1107,7 +1107,7 @@ gimplify_decl_expr (tree *stmt_p) ...@@ -1107,7 +1107,7 @@ gimplify_decl_expr (tree *stmt_p)
if (!TREE_STATIC (decl)) if (!TREE_STATIC (decl))
{ {
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
init = build (MODIFY_EXPR, void_type_node, decl, init); init = build2 (MODIFY_EXPR, void_type_node, decl, init);
gimplify_and_add (init, stmt_p); gimplify_and_add (init, stmt_p);
} }
else else
...@@ -1253,10 +1253,10 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p) ...@@ -1253,10 +1253,10 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
{ {
/* If the switch has no default label, add one, so that we jump /* If the switch has no default label, add one, so that we jump
around the switch body. */ around the switch body. */
default_case = build (CASE_LABEL_EXPR, void_type_node, NULL_TREE, default_case = build3 (CASE_LABEL_EXPR, void_type_node, NULL_TREE,
NULL_TREE, create_artificial_label ()); NULL_TREE, create_artificial_label ());
append_to_statement_list (SWITCH_BODY (switch_expr), pre_p); append_to_statement_list (SWITCH_BODY (switch_expr), pre_p);
*expr_p = build (LABEL_EXPR, void_type_node, *expr_p = build1 (LABEL_EXPR, void_type_node,
CASE_LABEL (default_case)); CASE_LABEL (default_case));
} }
else else
...@@ -1285,7 +1285,7 @@ gimplify_case_label_expr (tree *expr_p) ...@@ -1285,7 +1285,7 @@ gimplify_case_label_expr (tree *expr_p)
gcc_assert (gimplify_ctxp->case_labels); gcc_assert (gimplify_ctxp->case_labels);
VEC_safe_push (tree, heap, gimplify_ctxp->case_labels, expr); VEC_safe_push (tree, heap, gimplify_ctxp->case_labels, expr);
*expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr)); *expr_p = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
return GS_ALL_DONE; return GS_ALL_DONE;
} }
...@@ -1319,7 +1319,7 @@ gimplify_exit_expr (tree *expr_p) ...@@ -1319,7 +1319,7 @@ gimplify_exit_expr (tree *expr_p)
tree expr; tree expr;
expr = build_and_jump (&gimplify_ctxp->exit_label); expr = build_and_jump (&gimplify_ctxp->exit_label);
expr = build (COND_EXPR, void_type_node, cond, expr, NULL_TREE); expr = build3 (COND_EXPR, void_type_node, cond, expr, NULL_TREE);
*expr_p = expr; *expr_p = expr;
return GS_OK; return GS_OK;
...@@ -1759,8 +1759,8 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -1759,8 +1759,8 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
return ret; return ret;
} }
t1 = build (arith_code, TREE_TYPE (*expr_p), lhs, rhs); t1 = build2 (arith_code, TREE_TYPE (*expr_p), lhs, rhs);
t1 = build (MODIFY_EXPR, TREE_TYPE (lvalue), lvalue, t1); t1 = build2 (MODIFY_EXPR, TREE_TYPE (lvalue), lvalue, t1);
if (postfix) if (postfix)
{ {
...@@ -2007,7 +2007,7 @@ shortcut_cond_r (tree pred, tree *true_label_p, tree *false_label_p) ...@@ -2007,7 +2007,7 @@ shortcut_cond_r (tree pred, tree *true_label_p, tree *false_label_p)
if (b) goto yes; else goto no; if (b) goto yes; else goto no;
else else
if (c) goto yes; else goto no; */ if (c) goto yes; else goto no; */
expr = build (COND_EXPR, void_type_node, TREE_OPERAND (pred, 0), expr = build3 (COND_EXPR, void_type_node, TREE_OPERAND (pred, 0),
shortcut_cond_r (TREE_OPERAND (pred, 1), true_label_p, shortcut_cond_r (TREE_OPERAND (pred, 1), true_label_p,
false_label_p), false_label_p),
shortcut_cond_r (TREE_OPERAND (pred, 2), true_label_p, shortcut_cond_r (TREE_OPERAND (pred, 2), true_label_p,
...@@ -2015,7 +2015,7 @@ shortcut_cond_r (tree pred, tree *true_label_p, tree *false_label_p) ...@@ -2015,7 +2015,7 @@ shortcut_cond_r (tree pred, tree *true_label_p, tree *false_label_p)
} }
else else
{ {
expr = build (COND_EXPR, void_type_node, pred, expr = build3 (COND_EXPR, void_type_node, pred,
build_and_jump (true_label_p), build_and_jump (true_label_p),
build_and_jump (false_label_p)); build_and_jump (false_label_p));
} }
...@@ -2052,7 +2052,7 @@ shortcut_cond_expr (tree expr) ...@@ -2052,7 +2052,7 @@ shortcut_cond_expr (tree expr)
then_ = shortcut_cond_expr (expr); then_ = shortcut_cond_expr (expr);
then_se = then_ && TREE_SIDE_EFFECTS (then_); then_se = then_ && TREE_SIDE_EFFECTS (then_);
pred = TREE_OPERAND (pred, 0); pred = TREE_OPERAND (pred, 0);
expr = build (COND_EXPR, void_type_node, pred, then_, NULL_TREE); expr = build3 (COND_EXPR, void_type_node, pred, then_, NULL_TREE);
} }
} }
if (!then_se) if (!then_se)
...@@ -2067,7 +2067,7 @@ shortcut_cond_expr (tree expr) ...@@ -2067,7 +2067,7 @@ shortcut_cond_expr (tree expr)
else_ = shortcut_cond_expr (expr); else_ = shortcut_cond_expr (expr);
else_se = else_ && TREE_SIDE_EFFECTS (else_); else_se = else_ && TREE_SIDE_EFFECTS (else_);
pred = TREE_OPERAND (pred, 0); pred = TREE_OPERAND (pred, 0);
expr = build (COND_EXPR, void_type_node, pred, NULL_TREE, else_); expr = build3 (COND_EXPR, void_type_node, pred, NULL_TREE, else_);
} }
} }
...@@ -2282,7 +2282,7 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree *post_p, tree target, ...@@ -2282,7 +2282,7 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree *post_p, tree target,
tmp2 = tmp = create_tmp_var (type, "iftmp"); tmp2 = tmp = create_tmp_var (type, "iftmp");
expr = build (COND_EXPR, void_type_node, TREE_OPERAND (expr, 0), expr = build3 (COND_EXPR, void_type_node, TREE_OPERAND (expr, 0),
TREE_OPERAND (expr, 1), TREE_OPERAND (expr, 2)); TREE_OPERAND (expr, 1), TREE_OPERAND (expr, 2));
result = build_fold_indirect_ref (tmp); result = build_fold_indirect_ref (tmp);
...@@ -2293,12 +2293,12 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree *post_p, tree target, ...@@ -2293,12 +2293,12 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree *post_p, tree target,
if this branch is void; in C++ it can be, if it's a throw. */ if this branch is void; in C++ it can be, if it's a throw. */
if (TREE_TYPE (TREE_OPERAND (expr, 1)) != void_type_node) if (TREE_TYPE (TREE_OPERAND (expr, 1)) != void_type_node)
TREE_OPERAND (expr, 1) TREE_OPERAND (expr, 1)
= build (MODIFY_EXPR, void_type_node, tmp, TREE_OPERAND (expr, 1)); = build2 (MODIFY_EXPR, void_type_node, tmp, TREE_OPERAND (expr, 1));
/* Build the else clause, 't1 = b;'. */ /* Build the else clause, 't1 = b;'. */
if (TREE_TYPE (TREE_OPERAND (expr, 2)) != void_type_node) if (TREE_TYPE (TREE_OPERAND (expr, 2)) != void_type_node)
TREE_OPERAND (expr, 2) TREE_OPERAND (expr, 2)
= build (MODIFY_EXPR, void_type_node, tmp2, TREE_OPERAND (expr, 2)); = build2 (MODIFY_EXPR, void_type_node, tmp2, TREE_OPERAND (expr, 2));
TREE_TYPE (expr) = void_type_node; TREE_TYPE (expr) = void_type_node;
recalculate_side_effects (expr); recalculate_side_effects (expr);
...@@ -2712,13 +2712,13 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts, ...@@ -2712,13 +2712,13 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
if (array_elt_type) if (array_elt_type)
{ {
cref = build (ARRAY_REF, array_elt_type, unshare_expr (object), cref = build4 (ARRAY_REF, array_elt_type, unshare_expr (object),
purpose, NULL_TREE, NULL_TREE); purpose, NULL_TREE, NULL_TREE);
} }
else else
{ {
gcc_assert (TREE_CODE (purpose) == FIELD_DECL); gcc_assert (TREE_CODE (purpose) == FIELD_DECL);
cref = build (COMPONENT_REF, TREE_TYPE (purpose), cref = build3 (COMPONENT_REF, TREE_TYPE (purpose),
unshare_expr (object), purpose, NULL_TREE); unshare_expr (object), purpose, NULL_TREE);
} }
...@@ -2728,7 +2728,7 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts, ...@@ -2728,7 +2728,7 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
pre_p, cleared); pre_p, cleared);
else else
{ {
init = build (MODIFY_EXPR, TREE_TYPE (cref), cref, value); init = build2 (MODIFY_EXPR, TREE_TYPE (cref), cref, value);
gimplify_and_add (init, pre_p); gimplify_and_add (init, pre_p);
} }
} }
...@@ -2946,7 +2946,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, ...@@ -2946,7 +2946,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
} }
else else
{ {
ctor = build (COMPLEX_EXPR, type, r, i); ctor = build2 (COMPLEX_EXPR, type, r, i);
TREE_OPERAND (*expr_p, 1) = ctor; TREE_OPERAND (*expr_p, 1) = ctor;
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, ret = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
rhs_predicate_for (TREE_OPERAND (*expr_p, 0)), rhs_predicate_for (TREE_OPERAND (*expr_p, 0)),
...@@ -3377,7 +3377,7 @@ gimplify_variable_sized_compare (tree *expr_p) ...@@ -3377,7 +3377,7 @@ gimplify_variable_sized_compare (tree *expr_p)
t = implicit_built_in_decls[BUILT_IN_MEMCMP]; t = implicit_built_in_decls[BUILT_IN_MEMCMP];
t = build_function_call_expr (t, args); t = build_function_call_expr (t, args);
*expr_p *expr_p
= build (TREE_CODE (*expr_p), TREE_TYPE (*expr_p), t, integer_zero_node); = build2 (TREE_CODE (*expr_p), TREE_TYPE (*expr_p), t, integer_zero_node);
return GS_OK; return GS_OK;
} }
...@@ -3400,7 +3400,7 @@ gimplify_boolean_expr (tree *expr_p) ...@@ -3400,7 +3400,7 @@ gimplify_boolean_expr (tree *expr_p)
/* Preserve the original type of the expression. */ /* Preserve the original type of the expression. */
tree type = TREE_TYPE (*expr_p); tree type = TREE_TYPE (*expr_p);
*expr_p = build (COND_EXPR, type, *expr_p, *expr_p = build3 (COND_EXPR, type, *expr_p,
convert (type, boolean_true_node), convert (type, boolean_true_node),
convert (type, boolean_false_node)); convert (type, boolean_false_node));
...@@ -3847,7 +3847,7 @@ gimplify_cleanup_point_expr (tree *expr_p, tree *pre_p) ...@@ -3847,7 +3847,7 @@ gimplify_cleanup_point_expr (tree *expr_p, tree *pre_p)
code = TRY_FINALLY_EXPR; code = TRY_FINALLY_EXPR;
sl = tsi_split_statement_list_after (&iter); sl = tsi_split_statement_list_after (&iter);
tfe = build (code, void_type_node, sl, NULL_TREE); tfe = build2 (code, void_type_node, sl, NULL_TREE);
append_to_statement_list (TREE_OPERAND (wce, 0), append_to_statement_list (TREE_OPERAND (wce, 0),
&TREE_OPERAND (tfe, 1)); &TREE_OPERAND (tfe, 1));
*wce_p = tfe; *wce_p = tfe;
...@@ -3908,12 +3908,12 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p) ...@@ -3908,12 +3908,12 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
*/ */
tree flag = create_tmp_var (boolean_type_node, "cleanup"); tree flag = create_tmp_var (boolean_type_node, "cleanup");
tree ffalse = build (MODIFY_EXPR, void_type_node, flag, tree ffalse = build2 (MODIFY_EXPR, void_type_node, flag,
boolean_false_node); boolean_false_node);
tree ftrue = build (MODIFY_EXPR, void_type_node, flag, tree ftrue = build2 (MODIFY_EXPR, void_type_node, flag,
boolean_true_node); boolean_true_node);
cleanup = build (COND_EXPR, void_type_node, flag, cleanup, NULL); cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
wce = build (WITH_CLEANUP_EXPR, void_type_node, cleanup); wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
append_to_statement_list (ffalse, &gimplify_ctxp->conditional_cleanups); append_to_statement_list (ffalse, &gimplify_ctxp->conditional_cleanups);
append_to_statement_list (wce, &gimplify_ctxp->conditional_cleanups); append_to_statement_list (wce, &gimplify_ctxp->conditional_cleanups);
append_to_statement_list (ftrue, pre_p); append_to_statement_list (ftrue, pre_p);
...@@ -3925,7 +3925,7 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p) ...@@ -3925,7 +3925,7 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
} }
else else
{ {
wce = build (WITH_CLEANUP_EXPR, void_type_node, cleanup); wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
CLEANUP_EH_ONLY (wce) = eh_only; CLEANUP_EH_ONLY (wce) = eh_only;
append_to_statement_list (wce, pre_p); append_to_statement_list (wce, pre_p);
} }
...@@ -3961,7 +3961,7 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p) ...@@ -3961,7 +3961,7 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
gimplify_bind_expr (&init, temp, pre_p); gimplify_bind_expr (&init, temp, pre_p);
if (init != temp) if (init != temp)
{ {
init = build (MODIFY_EXPR, void_type_node, temp, init); init = build2 (MODIFY_EXPR, void_type_node, temp, init);
ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt, ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt,
fb_none); fb_none);
} }
...@@ -4562,7 +4562,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -4562,7 +4562,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
given a TREE_ADDRESSABLE type. */ given a TREE_ADDRESSABLE type. */
tree tmp = create_tmp_var_raw (type, "vol"); tree tmp = create_tmp_var_raw (type, "vol");
gimple_add_tmp_var (tmp); gimple_add_tmp_var (tmp);
*expr_p = build (MODIFY_EXPR, type, tmp, *expr_p); *expr_p = build2 (MODIFY_EXPR, type, tmp, *expr_p);
} }
else else
/* We can't do anything useful with a volatile reference to /* We can't do anything useful with a volatile reference to
...@@ -4912,7 +4912,7 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms) ...@@ -4912,7 +4912,7 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms)
/* If there isn't an outer BIND_EXPR, add one. */ /* If there isn't an outer BIND_EXPR, add one. */
if (TREE_CODE (body) != BIND_EXPR) if (TREE_CODE (body) != BIND_EXPR)
{ {
tree b = build (BIND_EXPR, void_type_node, NULL_TREE, tree b = build3 (BIND_EXPR, void_type_node, NULL_TREE,
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (b) = 1; TREE_SIDE_EFFECTS (b) = 1;
append_to_statement_list_force (body, &BIND_EXPR_BODY (b)); append_to_statement_list_force (body, &BIND_EXPR_BODY (b));
...@@ -4983,7 +4983,7 @@ gimplify_function_tree (tree fndecl) ...@@ -4983,7 +4983,7 @@ gimplify_function_tree (tree fndecl)
{ {
tree tf, x, bind; tree tf, x, bind;
tf = build (TRY_FINALLY_EXPR, void_type_node, NULL, NULL); tf = build2 (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
TREE_SIDE_EFFECTS (tf) = 1; TREE_SIDE_EFFECTS (tf) = 1;
x = DECL_SAVED_TREE (fndecl); x = DECL_SAVED_TREE (fndecl);
append_to_statement_list (x, &TREE_OPERAND (tf, 0)); append_to_statement_list (x, &TREE_OPERAND (tf, 0));
...@@ -4991,7 +4991,7 @@ gimplify_function_tree (tree fndecl) ...@@ -4991,7 +4991,7 @@ gimplify_function_tree (tree fndecl)
x = build_function_call_expr (x, NULL); x = build_function_call_expr (x, NULL);
append_to_statement_list (x, &TREE_OPERAND (tf, 1)); append_to_statement_list (x, &TREE_OPERAND (tf, 1));
bind = build (BIND_EXPR, void_type_node, NULL, NULL, NULL); bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
TREE_SIDE_EFFECTS (bind) = 1; TREE_SIDE_EFFECTS (bind) = 1;
x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER]; x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER];
x = build_function_call_expr (x, NULL); x = build_function_call_expr (x, NULL);
...@@ -5029,7 +5029,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var) ...@@ -5029,7 +5029,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
gimplify_ctxp->into_ssa = in_ssa_p; gimplify_ctxp->into_ssa = in_ssa_p;
if (var) if (var)
expr = build (MODIFY_EXPR, TREE_TYPE (var), var, expr); expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
ret = gimplify_expr (&expr, stmts, NULL, ret = gimplify_expr (&expr, stmts, NULL,
gimple_test_f, fb_rvalue); gimple_test_f, fb_rvalue);
......
...@@ -298,7 +298,7 @@ factor_computed_gotos (void) ...@@ -298,7 +298,7 @@ factor_computed_gotos (void)
} }
/* Copy the original computed goto's destination into VAR. */ /* Copy the original computed goto's destination into VAR. */
assignment = build (MODIFY_EXPR, ptr_type_node, assignment = build2 (MODIFY_EXPR, ptr_type_node,
var, GOTO_DESTINATION (last)); var, GOTO_DESTINATION (last));
bsi_insert_before (&bsi, assignment, BSI_SAME_STMT); bsi_insert_before (&bsi, assignment, BSI_SAME_STMT);
...@@ -5074,7 +5074,7 @@ gimplify_val (block_stmt_iterator *bsi, tree type, tree exp) ...@@ -5074,7 +5074,7 @@ gimplify_val (block_stmt_iterator *bsi, tree type, tree exp)
return exp; return exp;
t = make_rename_temp (type, NULL); t = make_rename_temp (type, NULL);
new_stmt = build (MODIFY_EXPR, type, t, exp); new_stmt = build2 (MODIFY_EXPR, type, t, exp);
orig_stmt = bsi_stmt (*bsi); orig_stmt = bsi_stmt (*bsi);
SET_EXPR_LOCUS (new_stmt, EXPR_LOCUS (orig_stmt)); SET_EXPR_LOCUS (new_stmt, EXPR_LOCUS (orig_stmt));
......
...@@ -105,7 +105,7 @@ build_polynomial_chrec (unsigned loop_num, ...@@ -105,7 +105,7 @@ build_polynomial_chrec (unsigned loop_num,
|| right == chrec_dont_know) || right == chrec_dont_know)
return chrec_dont_know; return chrec_dont_know;
return build (POLYNOMIAL_CHREC, TREE_TYPE (left), return build3 (POLYNOMIAL_CHREC, TREE_TYPE (left),
build_int_cst (NULL_TREE, loop_num), left, right); build_int_cst (NULL_TREE, loop_num), left, right);
} }
......
...@@ -629,7 +629,7 @@ update_complex_assignment (block_stmt_iterator *bsi, tree r, tree i) ...@@ -629,7 +629,7 @@ update_complex_assignment (block_stmt_iterator *bsi, tree r, tree i)
update_complex_components (bsi, stmt, r, i); update_complex_components (bsi, stmt, r, i);
type = TREE_TYPE (TREE_OPERAND (mod, 1)); type = TREE_TYPE (TREE_OPERAND (mod, 1));
TREE_OPERAND (mod, 1) = build (COMPLEX_EXPR, type, r, i); TREE_OPERAND (mod, 1) = build2 (COMPLEX_EXPR, type, r, i);
update_stmt (stmt); update_stmt (stmt);
} }
...@@ -1055,7 +1055,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1055,7 +1055,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
{ {
edge e; edge e;
cond = build (COND_EXPR, void_type_node, cond, NULL, NULL); cond = build3 (COND_EXPR, void_type_node, cond, NULL_TREE, NULL_TREE);
bsi_insert_before (bsi, cond, BSI_SAME_STMT); bsi_insert_before (bsi, cond, BSI_SAME_STMT);
/* Split the original block, and create the TRUE and FALSE blocks. */ /* Split the original block, and create the TRUE and FALSE blocks. */
...@@ -1065,8 +1065,8 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1065,8 +1065,8 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
bb_true = create_empty_bb (bb_cond); bb_true = create_empty_bb (bb_cond);
bb_false = create_empty_bb (bb_true); bb_false = create_empty_bb (bb_true);
t1 = build (GOTO_EXPR, void_type_node, tree_block_label (bb_true)); t1 = build1 (GOTO_EXPR, void_type_node, tree_block_label (bb_true));
t2 = build (GOTO_EXPR, void_type_node, tree_block_label (bb_false)); t2 = build1 (GOTO_EXPR, void_type_node, tree_block_label (bb_false));
COND_EXPR_THEN (cond) = t1; COND_EXPR_THEN (cond) = t1;
COND_EXPR_ELSE (cond) = t2; COND_EXPR_ELSE (cond) = t2;
...@@ -1120,9 +1120,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1120,9 +1120,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
if (bb_true) if (bb_true)
{ {
t1 = build (MODIFY_EXPR, inner_type, rr, tr); t1 = build2 (MODIFY_EXPR, inner_type, rr, tr);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
t1 = build (MODIFY_EXPR, inner_type, ri, ti); t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
bsi_remove (bsi); bsi_remove (bsi);
} }
...@@ -1159,9 +1159,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1159,9 +1159,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
if (bb_false) if (bb_false)
{ {
t1 = build (MODIFY_EXPR, inner_type, rr, tr); t1 = build2 (MODIFY_EXPR, inner_type, rr, tr);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
t1 = build (MODIFY_EXPR, inner_type, ri, ti); t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
bsi_remove (bsi); bsi_remove (bsi);
} }
......
...@@ -644,13 +644,13 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod, ...@@ -644,13 +644,13 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod,
else else
new = *return_value_p; new = *return_value_p;
x = build (MODIFY_EXPR, TREE_TYPE (new), new, old); x = build2 (MODIFY_EXPR, TREE_TYPE (new), new, old);
append_to_statement_list (x, &q->repl_stmt); append_to_statement_list (x, &q->repl_stmt);
if (new == result) if (new == result)
x = result; x = result;
else else
x = build (MODIFY_EXPR, TREE_TYPE (result), result, new); x = build2 (MODIFY_EXPR, TREE_TYPE (result), result, new);
q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x); q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
} }
...@@ -839,21 +839,21 @@ honor_protect_cleanup_actions (struct leh_state *outer_state, ...@@ -839,21 +839,21 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
save_filt = create_tmp_var (integer_type_node, "save_filt"); save_filt = create_tmp_var (integer_type_node, "save_filt");
i = tsi_start (finally); i = tsi_start (finally);
x = build (EXC_PTR_EXPR, ptr_type_node); x = build0 (EXC_PTR_EXPR, ptr_type_node);
x = build (MODIFY_EXPR, void_type_node, save_eptr, x); x = build2 (MODIFY_EXPR, void_type_node, save_eptr, x);
tsi_link_before (&i, x, TSI_CONTINUE_LINKING); tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
x = build (FILTER_EXPR, integer_type_node); x = build0 (FILTER_EXPR, integer_type_node);
x = build (MODIFY_EXPR, void_type_node, save_filt, x); x = build2 (MODIFY_EXPR, void_type_node, save_filt, x);
tsi_link_before (&i, x, TSI_CONTINUE_LINKING); tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
i = tsi_last (finally); i = tsi_last (finally);
x = build (EXC_PTR_EXPR, ptr_type_node); x = build0 (EXC_PTR_EXPR, ptr_type_node);
x = build (MODIFY_EXPR, void_type_node, x, save_eptr); x = build2 (MODIFY_EXPR, void_type_node, x, save_eptr);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING); tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
x = build (FILTER_EXPR, integer_type_node); x = build0 (FILTER_EXPR, integer_type_node);
x = build (MODIFY_EXPR, void_type_node, x, save_filt); x = build2 (MODIFY_EXPR, void_type_node, x, save_filt);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING); tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
x = build_resx (get_eh_region_number (tf->region)); x = build_resx (get_eh_region_number (tf->region));
...@@ -863,10 +863,10 @@ honor_protect_cleanup_actions (struct leh_state *outer_state, ...@@ -863,10 +863,10 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
/* Wrap the block with protect_cleanup_actions as the action. */ /* Wrap the block with protect_cleanup_actions as the action. */
if (protect_cleanup_actions) if (protect_cleanup_actions)
{ {
x = build (EH_FILTER_EXPR, void_type_node, NULL, NULL); x = build2 (EH_FILTER_EXPR, void_type_node, NULL, NULL);
append_to_statement_list (protect_cleanup_actions, &EH_FILTER_FAILURE (x)); append_to_statement_list (protect_cleanup_actions, &EH_FILTER_FAILURE (x));
EH_FILTER_MUST_NOT_THROW (x) = 1; EH_FILTER_MUST_NOT_THROW (x) = 1;
finally = build (TRY_CATCH_EXPR, void_type_node, finally, x); finally = build2 (TRY_CATCH_EXPR, void_type_node, finally, x);
lower_eh_filter (outer_state, &finally); lower_eh_filter (outer_state, &finally);
} }
else else
...@@ -1163,7 +1163,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1163,7 +1163,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
finally_label = create_artificial_label (); finally_label = create_artificial_label ();
case_label_vec = make_tree_vec (ndests); case_label_vec = make_tree_vec (ndests);
switch_stmt = build (SWITCH_EXPR, integer_type_node, finally_tmp, switch_stmt = build3 (SWITCH_EXPR, integer_type_node, finally_tmp,
NULL_TREE, case_label_vec); NULL_TREE, case_label_vec);
switch_body = NULL; switch_body = NULL;
last_case = NULL; last_case = NULL;
...@@ -1175,7 +1175,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1175,7 +1175,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
if (tf->may_fallthru) if (tf->may_fallthru)
{ {
x = build (MODIFY_EXPR, void_type_node, finally_tmp, x = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
build_int_cst (NULL_TREE, fallthru_index)); build_int_cst (NULL_TREE, fallthru_index));
append_to_statement_list (x, tf->top_p); append_to_statement_list (x, tf->top_p);
...@@ -1186,13 +1186,13 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1186,13 +1186,13 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
} }
last_case = build (CASE_LABEL_EXPR, void_type_node, last_case = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (NULL_TREE, fallthru_index), NULL, build_int_cst (NULL_TREE, fallthru_index), NULL,
create_artificial_label ()); create_artificial_label ());
TREE_VEC_ELT (case_label_vec, last_case_index) = last_case; TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
last_case_index++; last_case_index++;
x = build (LABEL_EXPR, void_type_node, CASE_LABEL (last_case)); x = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (last_case));
append_to_statement_list (x, &switch_body); append_to_statement_list (x, &switch_body);
x = lower_try_finally_fallthru_label (tf); x = lower_try_finally_fallthru_label (tf);
...@@ -1205,17 +1205,17 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1205,17 +1205,17 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
x = build1 (LABEL_EXPR, void_type_node, tf->eh_label); x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
append_to_statement_list (x, tf->top_p); append_to_statement_list (x, tf->top_p);
x = build (MODIFY_EXPR, void_type_node, finally_tmp, x = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
build_int_cst (NULL_TREE, eh_index)); build_int_cst (NULL_TREE, eh_index));
append_to_statement_list (x, tf->top_p); append_to_statement_list (x, tf->top_p);
last_case = build (CASE_LABEL_EXPR, void_type_node, last_case = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (NULL_TREE, eh_index), NULL, build_int_cst (NULL_TREE, eh_index), NULL,
create_artificial_label ()); create_artificial_label ());
TREE_VEC_ELT (case_label_vec, last_case_index) = last_case; TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
last_case_index++; last_case_index++;
x = build (LABEL_EXPR, void_type_node, CASE_LABEL (last_case)); x = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (last_case));
append_to_statement_list (x, &switch_body); append_to_statement_list (x, &switch_body);
x = build_resx (get_eh_region_number (tf->region)); x = build_resx (get_eh_region_number (tf->region));
append_to_statement_list (x, &switch_body); append_to_statement_list (x, &switch_body);
...@@ -1237,14 +1237,14 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1237,14 +1237,14 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
if (q->index < 0) if (q->index < 0)
{ {
mod = build (MODIFY_EXPR, void_type_node, finally_tmp, mod = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
build_int_cst (NULL_TREE, return_index)); build_int_cst (NULL_TREE, return_index));
do_return_redirection (q, finally_label, mod, &return_val); do_return_redirection (q, finally_label, mod, &return_val);
switch_id = return_index; switch_id = return_index;
} }
else else
{ {
mod = build (MODIFY_EXPR, void_type_node, finally_tmp, mod = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
build_int_cst (NULL_TREE, q->index)); build_int_cst (NULL_TREE, q->index));
do_goto_redirection (q, finally_label, mod); do_goto_redirection (q, finally_label, mod);
switch_id = q->index; switch_id = q->index;
...@@ -1253,7 +1253,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1253,7 +1253,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
case_index = j + q->index; case_index = j + q->index;
if (!TREE_VEC_ELT (case_label_vec, case_index)) if (!TREE_VEC_ELT (case_label_vec, case_index))
TREE_VEC_ELT (case_label_vec, case_index) TREE_VEC_ELT (case_label_vec, case_index)
= build (CASE_LABEL_EXPR, void_type_node, = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (NULL_TREE, switch_id), NULL, build_int_cst (NULL_TREE, switch_id), NULL,
/* We store the cont_stmt in the /* We store the cont_stmt in the
CASE_LABEL, so that we can recover it CASE_LABEL, so that we can recover it
...@@ -1277,7 +1277,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1277,7 +1277,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
label = create_artificial_label (); label = create_artificial_label ();
CASE_LABEL (last_case) = label; CASE_LABEL (last_case) = label;
x = build (LABEL_EXPR, void_type_node, label); x = build1 (LABEL_EXPR, void_type_node, label);
append_to_statement_list (x, &switch_body); append_to_statement_list (x, &switch_body);
append_to_statement_list (cont_stmt, &switch_body); append_to_statement_list (cont_stmt, &switch_body);
maybe_record_in_goto_queue (state, cont_stmt); maybe_record_in_goto_queue (state, cont_stmt);
......
...@@ -630,7 +630,7 @@ add_to_dst_predicate_list (struct loop * loop, basic_block bb, ...@@ -630,7 +630,7 @@ add_to_dst_predicate_list (struct loop * loop, basic_block bb,
bsi_insert_before (bsi, tmp_stmts2, BSI_SAME_STMT); bsi_insert_before (bsi, tmp_stmts2, BSI_SAME_STMT);
/* new_cond == prev_cond AND cond */ /* new_cond == prev_cond AND cond */
tmp = build (TRUTH_AND_EXPR, boolean_type_node, tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
unshare_expr (prev_cond), cond); unshare_expr (prev_cond), cond);
tmp_stmt = ifc_temp_var (boolean_type_node, tmp); tmp_stmt = ifc_temp_var (boolean_type_node, tmp);
bsi_insert_before (bsi, tmp_stmt, BSI_SAME_STMT); bsi_insert_before (bsi, tmp_stmt, BSI_SAME_STMT);
...@@ -792,12 +792,12 @@ replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb, ...@@ -792,12 +792,12 @@ replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb,
} }
/* Build new RHS using selected condition and arguments. */ /* Build new RHS using selected condition and arguments. */
rhs = build (COND_EXPR, TREE_TYPE (PHI_RESULT (phi)), rhs = build3 (COND_EXPR, TREE_TYPE (PHI_RESULT (phi)),
unshare_expr (cond), unshare_expr (arg_0), unshare_expr (cond), unshare_expr (arg_0),
unshare_expr (arg_1)); unshare_expr (arg_1));
/* Create new MODIFY expression using RHS. */ /* Create new MODIFY expression using RHS. */
new_stmt = build (MODIFY_EXPR, TREE_TYPE (PHI_RESULT (phi)), new_stmt = build2 (MODIFY_EXPR, TREE_TYPE (PHI_RESULT (phi)),
unshare_expr (PHI_RESULT (phi)), rhs); unshare_expr (PHI_RESULT (phi)), rhs);
/* Make new statement definition of the original phi result. */ /* Make new statement definition of the original phi result. */
...@@ -993,7 +993,7 @@ ifc_temp_var (tree type, tree exp) ...@@ -993,7 +993,7 @@ ifc_temp_var (tree type, tree exp)
add_referenced_tmp_var (var); add_referenced_tmp_var (var);
/* Build new statement to assign EXP to new variable. */ /* Build new statement to assign EXP to new variable. */
stmt = build (MODIFY_EXPR, type, var, exp); stmt = build2 (MODIFY_EXPR, type, var, exp);
/* Get SSA name for the new variable and set make new statement /* Get SSA name for the new variable and set make new statement
its definition statement. */ its definition statement. */
......
...@@ -1148,7 +1148,7 @@ setup_one_parameter (inline_data *id, tree p, tree value, tree fn, ...@@ -1148,7 +1148,7 @@ setup_one_parameter (inline_data *id, tree p, tree value, tree fn,
/* We want to use MODIFY_EXPR, not INIT_EXPR here so that we /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we
keep our trees in gimple form. */ keep our trees in gimple form. */
init_stmt = build (MODIFY_EXPR, TREE_TYPE (var), var, rhs); init_stmt = build2 (MODIFY_EXPR, TREE_TYPE (var), var, rhs);
/* If we did not create a gimple value and we did not create a gimple /* If we did not create a gimple value and we did not create a gimple
cast of a gimple value, then we will need to gimplify INIT_STMTS cast of a gimple value, then we will need to gimplify INIT_STMTS
......
...@@ -453,13 +453,13 @@ mf_decl_cache_locals (void) ...@@ -453,13 +453,13 @@ mf_decl_cache_locals (void)
/* Build initialization nodes for the cache vars. We just load the /* Build initialization nodes for the cache vars. We just load the
globals into the cache variables. */ globals into the cache variables. */
t = build (MODIFY_EXPR, TREE_TYPE (mf_cache_shift_decl_l), t = build2 (MODIFY_EXPR, TREE_TYPE (mf_cache_shift_decl_l),
mf_cache_shift_decl_l, mf_cache_shift_decl); mf_cache_shift_decl_l, mf_cache_shift_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl)); SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
shift_init_stmts = t; shift_init_stmts = t;
t = build (MODIFY_EXPR, TREE_TYPE (mf_cache_mask_decl_l), t = build2 (MODIFY_EXPR, TREE_TYPE (mf_cache_mask_decl_l),
mf_cache_mask_decl_l, mf_cache_mask_decl); mf_cache_mask_decl_l, mf_cache_mask_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl)); SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
...@@ -548,7 +548,7 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -548,7 +548,7 @@ mf_build_check_statement_for (tree base, tree limit,
mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit"); mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit");
/* Build: __mf_base = (uintptr_t) <base address expression>. */ /* Build: __mf_base = (uintptr_t) <base address expression>. */
t = build (MODIFY_EXPR, void_type_node, mf_base, t = build2 (MODIFY_EXPR, void_type_node, mf_base,
convert (mf_uintptr_type, unshare_expr (base))); convert (mf_uintptr_type, unshare_expr (base)));
SET_EXPR_LOCUS (t, locus); SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
...@@ -556,7 +556,7 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -556,7 +556,7 @@ mf_build_check_statement_for (tree base, tree limit,
tsi = tsi_last (t); tsi = tsi_last (t);
/* Build: __mf_limit = (uintptr_t) <limit address expression>. */ /* Build: __mf_limit = (uintptr_t) <limit address expression>. */
t = build (MODIFY_EXPR, void_type_node, mf_limit, t = build2 (MODIFY_EXPR, void_type_node, mf_limit,
convert (mf_uintptr_type, unshare_expr (limit))); convert (mf_uintptr_type, unshare_expr (limit)));
SET_EXPR_LOCUS (t, locus); SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
...@@ -564,15 +564,15 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -564,15 +564,15 @@ mf_build_check_statement_for (tree base, tree limit,
/* Build: __mf_elem = &__mf_lookup_cache [(__mf_base >> __mf_shift) /* Build: __mf_elem = &__mf_lookup_cache [(__mf_base >> __mf_shift)
& __mf_mask]. */ & __mf_mask]. */
t = build (RSHIFT_EXPR, mf_uintptr_type, mf_base, t = build2 (RSHIFT_EXPR, mf_uintptr_type, mf_base,
(flag_mudflap_threads ? mf_cache_shift_decl : mf_cache_shift_decl_l)); (flag_mudflap_threads ? mf_cache_shift_decl : mf_cache_shift_decl_l));
t = build (BIT_AND_EXPR, mf_uintptr_type, t, t = build2 (BIT_AND_EXPR, mf_uintptr_type, t,
(flag_mudflap_threads ? mf_cache_mask_decl : mf_cache_mask_decl_l)); (flag_mudflap_threads ? mf_cache_mask_decl : mf_cache_mask_decl_l));
t = build (ARRAY_REF, t = build4 (ARRAY_REF,
TREE_TYPE (TREE_TYPE (mf_cache_array_decl)), TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
mf_cache_array_decl, t, NULL_TREE, NULL_TREE); mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
t = build1 (ADDR_EXPR, mf_cache_structptr_type, t); t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
t = build (MODIFY_EXPR, void_type_node, mf_elem, t); t = build2 (MODIFY_EXPR, void_type_node, mf_elem, t);
SET_EXPR_LOCUS (t, locus); SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
...@@ -592,10 +592,10 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -592,10 +592,10 @@ mf_build_check_statement_for (tree base, tree limit,
the edge to the THEN clause of the conditional jump as unlikely. */ the edge to the THEN clause of the conditional jump as unlikely. */
/* Construct t <-- '__mf_elem->low > __mf_base'. */ /* Construct t <-- '__mf_elem->low > __mf_base'. */
t = build (COMPONENT_REF, mf_uintptr_type, t = build3 (COMPONENT_REF, mf_uintptr_type,
build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem), build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
TYPE_FIELDS (mf_cache_struct_type), NULL_TREE); TYPE_FIELDS (mf_cache_struct_type), NULL_TREE);
t = build (GT_EXPR, boolean_type_node, t, mf_base); t = build2 (GT_EXPR, boolean_type_node, t, mf_base);
/* Construct '__mf_elem->high < __mf_limit'. /* Construct '__mf_elem->high < __mf_limit'.
...@@ -605,28 +605,28 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -605,28 +605,28 @@ mf_build_check_statement_for (tree base, tree limit,
Then build 'u <-- (u < v). */ Then build 'u <-- (u < v). */
u = build (COMPONENT_REF, mf_uintptr_type, u = build3 (COMPONENT_REF, mf_uintptr_type,
build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem), build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
TREE_CHAIN (TYPE_FIELDS (mf_cache_struct_type)), NULL_TREE); TREE_CHAIN (TYPE_FIELDS (mf_cache_struct_type)), NULL_TREE);
v = mf_limit; v = mf_limit;
u = build (LT_EXPR, boolean_type_node, u, v); u = build2 (LT_EXPR, boolean_type_node, u, v);
/* Build the composed conditional: t <-- 't || u'. Then store the /* Build the composed conditional: t <-- 't || u'. Then store the
result of the evaluation of 't' in a temporary variable which we result of the evaluation of 't' in a temporary variable which we
can use as the condition for the conditional jump. */ can use as the condition for the conditional jump. */
t = build (TRUTH_OR_EXPR, boolean_type_node, t, u); t = build2 (TRUTH_OR_EXPR, boolean_type_node, t, u);
cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond"); cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
t = build (MODIFY_EXPR, boolean_type_node, cond, t); t = build2 (MODIFY_EXPR, boolean_type_node, cond, t);
gimplify_to_stmt_list (&t); gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
/* Build the conditional jump. 'cond' is just a temporary so we can /* Build the conditional jump. 'cond' is just a temporary so we can
simply build a void COND_EXPR. We do need labels in both arms though. */ simply build a void COND_EXPR. We do need labels in both arms though. */
t = build (COND_EXPR, void_type_node, cond, t = build3 (COND_EXPR, void_type_node, cond,
build (GOTO_EXPR, void_type_node, tree_block_label (then_bb)), build1 (GOTO_EXPR, void_type_node, tree_block_label (then_bb)),
build (GOTO_EXPR, void_type_node, tree_block_label (join_bb))); build1 (GOTO_EXPR, void_type_node, tree_block_label (join_bb)));
SET_EXPR_LOCUS (t, locus); SET_EXPR_LOCUS (t, locus);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
...@@ -671,11 +671,11 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -671,11 +671,11 @@ mf_build_check_statement_for (tree base, tree limit,
if (! flag_mudflap_threads) if (! flag_mudflap_threads)
{ {
t = build (MODIFY_EXPR, void_type_node, t = build2 (MODIFY_EXPR, void_type_node,
mf_cache_shift_decl_l, mf_cache_shift_decl); mf_cache_shift_decl_l, mf_cache_shift_decl);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
t = build (MODIFY_EXPR, void_type_node, t = build2 (MODIFY_EXPR, void_type_node,
mf_cache_mask_decl_l, mf_cache_mask_decl); mf_cache_mask_decl_l, mf_cache_mask_decl);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
} }
...@@ -1053,7 +1053,7 @@ mx_register_decls (tree decl, tree *stmt_list) ...@@ -1053,7 +1053,7 @@ mx_register_decls (tree decl, tree *stmt_list)
/* Actually, (initially_stmts!=NULL) <=> (finally_stmts!=NULL) */ /* Actually, (initially_stmts!=NULL) <=> (finally_stmts!=NULL) */
if (finally_stmts != NULL_TREE) if (finally_stmts != NULL_TREE)
{ {
tree t = build (TRY_FINALLY_EXPR, void_type_node, tree t = build2 (TRY_FINALLY_EXPR, void_type_node,
*stmt_list, finally_stmts); *stmt_list, finally_stmts);
*stmt_list = NULL; *stmt_list = NULL;
append_to_statement_list (t, stmt_list); append_to_statement_list (t, stmt_list);
......
...@@ -380,7 +380,7 @@ init_tmp_var (struct nesting_info *info, tree exp, tree_stmt_iterator *tsi) ...@@ -380,7 +380,7 @@ init_tmp_var (struct nesting_info *info, tree exp, tree_stmt_iterator *tsi)
tree t, stmt; tree t, stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL); t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
stmt = build (MODIFY_EXPR, TREE_TYPE (t), t, exp); stmt = build2 (MODIFY_EXPR, TREE_TYPE (t), t, exp);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi))); SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_before (tsi, stmt, TSI_SAME_STMT); tsi_link_before (tsi, stmt, TSI_SAME_STMT);
...@@ -408,7 +408,7 @@ save_tmp_var (struct nesting_info *info, tree exp, ...@@ -408,7 +408,7 @@ save_tmp_var (struct nesting_info *info, tree exp,
tree t, stmt; tree t, stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL); t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
stmt = build (MODIFY_EXPR, TREE_TYPE (t), exp, t); stmt = build2 (MODIFY_EXPR, TREE_TYPE (t), exp, t);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi))); SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_after (tsi, stmt, TSI_SAME_STMT); tsi_link_after (tsi, stmt, TSI_SAME_STMT);
...@@ -749,7 +749,7 @@ get_static_chain (struct nesting_info *info, tree target_context, ...@@ -749,7 +749,7 @@ get_static_chain (struct nesting_info *info, tree target_context,
tree field = get_chain_field (i); tree field = get_chain_field (i);
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x); x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
x = build (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, tsi); x = init_tmp_var (info, x, tsi);
} }
} }
...@@ -783,14 +783,14 @@ get_frame_field (struct nesting_info *info, tree target_context, ...@@ -783,14 +783,14 @@ get_frame_field (struct nesting_info *info, tree target_context,
tree field = get_chain_field (i); tree field = get_chain_field (i);
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x); x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
x = build (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, tsi); x = init_tmp_var (info, x, tsi);
} }
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x); x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
} }
x = build (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
return x; return x;
} }
...@@ -1370,9 +1370,9 @@ finalize_nesting_tree_1 (struct nesting_info *root) ...@@ -1370,9 +1370,9 @@ finalize_nesting_tree_1 (struct nesting_info *root)
else else
x = p; x = p;
y = build (COMPONENT_REF, TREE_TYPE (field), y = build3 (COMPONENT_REF, TREE_TYPE (field),
root->frame_decl, field, NULL_TREE); root->frame_decl, field, NULL_TREE);
x = build (MODIFY_EXPR, TREE_TYPE (field), y, x); x = build2 (MODIFY_EXPR, TREE_TYPE (field), y, x);
append_to_statement_list (x, &stmt_list); append_to_statement_list (x, &stmt_list);
} }
} }
...@@ -1381,9 +1381,9 @@ finalize_nesting_tree_1 (struct nesting_info *root) ...@@ -1381,9 +1381,9 @@ finalize_nesting_tree_1 (struct nesting_info *root)
from chain_decl. */ from chain_decl. */
if (root->chain_field) if (root->chain_field)
{ {
tree x = build (COMPONENT_REF, TREE_TYPE (root->chain_field), tree x = build3 (COMPONENT_REF, TREE_TYPE (root->chain_field),
root->frame_decl, root->chain_field, NULL_TREE); root->frame_decl, root->chain_field, NULL_TREE);
x = build (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root)); x = build2 (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
append_to_statement_list (x, &stmt_list); append_to_statement_list (x, &stmt_list);
} }
...@@ -1408,7 +1408,7 @@ finalize_nesting_tree_1 (struct nesting_info *root) ...@@ -1408,7 +1408,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
x = build_addr (i->context, context); x = build_addr (i->context, context);
arg = tree_cons (NULL, x, arg); arg = tree_cons (NULL, x, arg);
x = build (COMPONENT_REF, TREE_TYPE (field), x = build3 (COMPONENT_REF, TREE_TYPE (field),
root->frame_decl, field, NULL_TREE); root->frame_decl, field, NULL_TREE);
x = build_addr (x, context); x = build_addr (x, context);
arg = tree_cons (NULL, x, arg); arg = tree_cons (NULL, x, arg);
......
...@@ -191,7 +191,7 @@ insert_copy_on_edge (edge e, tree dest, tree src) ...@@ -191,7 +191,7 @@ insert_copy_on_edge (edge e, tree dest, tree src)
{ {
tree copy; tree copy;
copy = build (MODIFY_EXPR, TREE_TYPE (dest), dest, src); copy = build2 (MODIFY_EXPR, TREE_TYPE (dest), dest, src);
set_is_used (dest); set_is_used (dest);
if (TREE_CODE (src) == ADDR_EXPR) if (TREE_CODE (src) == ADDR_EXPR)
...@@ -2471,8 +2471,8 @@ insert_backedge_copies (void) ...@@ -2471,8 +2471,8 @@ insert_backedge_copies (void)
/* Create a new instance of the underlying /* Create a new instance of the underlying
variable of the PHI result. */ variable of the PHI result. */
stmt = build (MODIFY_EXPR, TREE_TYPE (result_var), stmt = build2 (MODIFY_EXPR, TREE_TYPE (result_var),
NULL, PHI_ARG_DEF (phi, i)); NULL_TREE, PHI_ARG_DEF (phi, i));
name = make_ssa_name (result_var, stmt); name = make_ssa_name (result_var, stmt);
TREE_OPERAND (stmt, 0) = name; TREE_OPERAND (stmt, 0) = name;
......
...@@ -106,11 +106,11 @@ tree_gen_edge_profiler (int edgeno, edge e) ...@@ -106,11 +106,11 @@ tree_gen_edge_profiler (int edgeno, edge e)
tree tmp1 = create_tmp_var (gcov_type_node, "PROF"); tree tmp1 = create_tmp_var (gcov_type_node, "PROF");
tree tmp2 = create_tmp_var (gcov_type_node, "PROF"); tree tmp2 = create_tmp_var (gcov_type_node, "PROF");
tree ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno); tree ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
tree stmt1 = build (MODIFY_EXPR, gcov_type_node, tmp1, ref); tree stmt1 = build2 (MODIFY_EXPR, gcov_type_node, tmp1, ref);
tree stmt2 = build (MODIFY_EXPR, gcov_type_node, tmp2, tree stmt2 = build2 (MODIFY_EXPR, gcov_type_node, tmp2,
build (PLUS_EXPR, gcov_type_node, build2 (PLUS_EXPR, gcov_type_node,
tmp1, integer_one_node)); tmp1, integer_one_node));
tree stmt3 = build (MODIFY_EXPR, gcov_type_node, ref, tmp2); tree stmt3 = build2 (MODIFY_EXPR, gcov_type_node, ref, tmp2);
bsi_insert_on_edge (e, stmt1); bsi_insert_on_edge (e, stmt1);
bsi_insert_on_edge (e, stmt2); bsi_insert_on_edge (e, stmt2);
bsi_insert_on_edge (e, stmt3); bsi_insert_on_edge (e, stmt3);
......
...@@ -1589,7 +1589,7 @@ maybe_fold_offset_to_array_ref (tree base, tree offset, tree orig_type) ...@@ -1589,7 +1589,7 @@ maybe_fold_offset_to_array_ref (tree base, tree offset, tree orig_type)
if (!integer_zerop (elt_offset)) if (!integer_zerop (elt_offset))
idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0); idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0);
return build (ARRAY_REF, orig_type, base, idx, min_idx, return build4 (ARRAY_REF, orig_type, base, idx, min_idx,
size_int (tree_low_cst (elt_size, 1) size_int (tree_low_cst (elt_size, 1)
/ (TYPE_ALIGN_UNIT (elt_type)))); / (TYPE_ALIGN_UNIT (elt_type))));
} }
...@@ -1652,7 +1652,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset, ...@@ -1652,7 +1652,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset,
{ {
if (base_is_ptr) if (base_is_ptr)
base = build1 (INDIRECT_REF, record_type, base); base = build1 (INDIRECT_REF, record_type, base);
t = build (COMPONENT_REF, field_type, base, f, NULL_TREE); t = build3 (COMPONENT_REF, field_type, base, f, NULL_TREE);
return t; return t;
} }
...@@ -1692,7 +1692,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset, ...@@ -1692,7 +1692,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset,
nonzero offset into them. Recurse and hope for a valid match. */ nonzero offset into them. Recurse and hope for a valid match. */
if (base_is_ptr) if (base_is_ptr)
base = build1 (INDIRECT_REF, record_type, base); base = build1 (INDIRECT_REF, record_type, base);
base = build (COMPONENT_REF, field_type, base, f, NULL_TREE); base = build3 (COMPONENT_REF, field_type, base, f, NULL_TREE);
t = maybe_fold_offset_to_array_ref (base, offset, orig_type); t = maybe_fold_offset_to_array_ref (base, offset, orig_type);
if (t) if (t)
......
...@@ -834,9 +834,9 @@ thread_across_edge (struct dom_walk_data *walk_data, edge e) ...@@ -834,9 +834,9 @@ thread_across_edge (struct dom_walk_data *walk_data, edge e)
dummy_cond = walk_data->global_data; dummy_cond = walk_data->global_data;
if (! dummy_cond) if (! dummy_cond)
{ {
dummy_cond = build (cond_code, boolean_type_node, op0, op1); dummy_cond = build2 (cond_code, boolean_type_node, op0, op1);
dummy_cond = build (COND_EXPR, void_type_node, dummy_cond = build3 (COND_EXPR, void_type_node,
dummy_cond, NULL, NULL); dummy_cond, NULL_TREE, NULL_TREE);
walk_data->global_data = dummy_cond; walk_data->global_data = dummy_cond;
} }
else else
...@@ -1851,17 +1851,17 @@ simplify_rhs_and_lookup_avail_expr (tree stmt, int insert) ...@@ -1851,17 +1851,17 @@ simplify_rhs_and_lookup_avail_expr (tree stmt, int insert)
if (rhs_def_code != rhs_code) if (rhs_def_code != rhs_code)
{ {
if (rhs_def_code == MINUS_EXPR) if (rhs_def_code == MINUS_EXPR)
t = build (MINUS_EXPR, type, outer_const, def_stmt_op1); t = build2 (MINUS_EXPR, type, outer_const, def_stmt_op1);
else else
t = build (MINUS_EXPR, type, def_stmt_op1, outer_const); t = build2 (MINUS_EXPR, type, def_stmt_op1, outer_const);
rhs_code = PLUS_EXPR; rhs_code = PLUS_EXPR;
} }
else if (rhs_def_code == MINUS_EXPR) else if (rhs_def_code == MINUS_EXPR)
t = build (PLUS_EXPR, type, def_stmt_op1, outer_const); t = build2 (PLUS_EXPR, type, def_stmt_op1, outer_const);
else else
t = build (rhs_def_code, type, def_stmt_op1, outer_const); t = build2 (rhs_def_code, type, def_stmt_op1, outer_const);
t = local_fold (t); t = local_fold (t);
t = build (rhs_code, type, def_stmt_op0, t); t = build2 (rhs_code, type, def_stmt_op0, t);
t = local_fold (t); t = local_fold (t);
/* If the result is a suitable looking gimple expression, /* If the result is a suitable looking gimple expression,
...@@ -1969,7 +1969,7 @@ find_equivalent_equality_comparison (tree cond) ...@@ -1969,7 +1969,7 @@ find_equivalent_equality_comparison (tree cond)
new = build1 (TREE_CODE (def_rhs), def_rhs_inner_type, op1); new = build1 (TREE_CODE (def_rhs), def_rhs_inner_type, op1);
new = local_fold (new); new = local_fold (new);
if (is_gimple_val (new) && tree_int_cst_equal (new, op1)) if (is_gimple_val (new) && tree_int_cst_equal (new, op1))
return build (TREE_CODE (cond), TREE_TYPE (cond), return build2 (TREE_CODE (cond), TREE_TYPE (cond),
def_rhs_inner, new); def_rhs_inner, new);
} }
} }
...@@ -2752,7 +2752,7 @@ record_equivalences_from_stmt (tree stmt, ...@@ -2752,7 +2752,7 @@ record_equivalences_from_stmt (tree stmt,
if (rhs) if (rhs)
{ {
/* Build a new statement with the RHS and LHS exchanged. */ /* Build a new statement with the RHS and LHS exchanged. */
new = build (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs); new = build2 (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs);
create_ssa_artficial_load_stmt (new, stmt); create_ssa_artficial_load_stmt (new, stmt);
......
...@@ -1070,7 +1070,7 @@ schedule_sm (struct loop *loop, edge *exits, unsigned n_exits, tree ref, ...@@ -1070,7 +1070,7 @@ schedule_sm (struct loop *loop, edge *exits, unsigned n_exits, tree ref,
LIM_DATA (aref->stmt)->sm_done = true; LIM_DATA (aref->stmt)->sm_done = true;
/* Emit the load & stores. */ /* Emit the load & stores. */
load = build (MODIFY_EXPR, void_type_node, tmp_var, ref); load = build2 (MODIFY_EXPR, void_type_node, tmp_var, ref);
get_stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data)); get_stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
LIM_DATA (load)->max_loop = loop; LIM_DATA (load)->max_loop = loop;
LIM_DATA (load)->tgt_loop = loop; LIM_DATA (load)->tgt_loop = loop;
...@@ -1081,7 +1081,7 @@ schedule_sm (struct loop *loop, edge *exits, unsigned n_exits, tree ref, ...@@ -1081,7 +1081,7 @@ schedule_sm (struct loop *loop, edge *exits, unsigned n_exits, tree ref,
for (i = 0; i < n_exits; i++) for (i = 0; i < n_exits; i++)
{ {
store = build (MODIFY_EXPR, void_type_node, store = build2 (MODIFY_EXPR, void_type_node,
unshare_expr (ref), tmp_var); unshare_expr (ref), tmp_var);
bsi_insert_on_edge (exits[i], store); bsi_insert_on_edge (exits[i], store);
} }
......
...@@ -1595,7 +1595,7 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts) ...@@ -1595,7 +1595,7 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts)
add_referenced_tmp_var (temp); add_referenced_tmp_var (temp);
if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE) if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
DECL_COMPLEX_GIMPLE_REG_P (temp) = 1; DECL_COMPLEX_GIMPLE_REG_P (temp) = 1;
newexpr = build (MODIFY_EXPR, TREE_TYPE (expr), temp, newexpr); newexpr = build2 (MODIFY_EXPR, TREE_TYPE (expr), temp, newexpr);
name = make_ssa_name (temp, newexpr); name = make_ssa_name (temp, newexpr);
TREE_OPERAND (newexpr, 0) = name; TREE_OPERAND (newexpr, 0) = name;
NECESSARY (newexpr) = 0; NECESSARY (newexpr) = 0;
......
...@@ -2019,7 +2019,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt) ...@@ -2019,7 +2019,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
/* Arguments are ready. create the new vector stmt. */ /* Arguments are ready. create the new vector stmt. */
vec_compare = build2 (TREE_CODE (cond_expr), vectype, vec_compare = build2 (TREE_CODE (cond_expr), vectype,
vec_cond_lhs, vec_cond_rhs); vec_cond_lhs, vec_cond_rhs);
vec_cond_expr = build (VEC_COND_EXPR, vectype, vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
vec_compare, vec_then_clause, vec_else_clause); vec_compare, vec_then_clause, vec_else_clause);
*vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, vec_cond_expr); *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, vec_cond_expr);
......
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