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);
......
...@@ -298,8 +298,8 @@ factor_computed_gotos (void) ...@@ -298,8 +298,8 @@ 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);
/* And re-vector the computed goto to the new destination. */ /* And re-vector the computed goto to the new destination. */
...@@ -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,8 +105,8 @@ build_polynomial_chrec (unsigned loop_num, ...@@ -105,8 +105,8 @@ 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,8 +1163,8 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1163,8 +1163,8 @@ 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;
last_case_index = 0; last_case_index = 0;
...@@ -1175,8 +1175,8 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1175,8 +1175,8 @@ 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);
if (tf->may_throw) if (tf->may_throw)
...@@ -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,15 +1237,15 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1237,15 +1237,15 @@ 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,15 +1253,15 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1253,15 +1253,15 @@ 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
in the loop below. We don't create in the loop below. We don't create
the new label while walking the the new label while walking the
goto_queue because pointers don't goto_queue because pointers don't
offer a stable order. */ offer a stable order. */
q->cont_stmt); q->cont_stmt);
} }
for (j = last_case_index; j < last_case_index + nlabels; j++) for (j = last_case_index; j < last_case_index + nlabels; j++)
{ {
...@@ -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,8 +630,8 @@ add_to_dst_predicate_list (struct loop * loop, basic_block bb, ...@@ -630,8 +630,8 @@ 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);
new_cond = TREE_OPERAND (tmp_stmt, 0); new_cond = TREE_OPERAND (tmp_stmt, 0);
...@@ -792,13 +792,13 @@ replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb, ...@@ -792,13 +792,13 @@ 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. */
SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = new_stmt; SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = new_stmt;
...@@ -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,14 +453,14 @@ mf_decl_cache_locals (void) ...@@ -453,14 +453,14 @@ 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);
mask_init_stmts = t; mask_init_stmts = t;
...@@ -548,31 +548,31 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -548,31 +548,31 @@ 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);
head = tsi_start (t); head = tsi_start (t);
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);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING); tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
/* 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,12 +671,12 @@ mf_build_check_statement_for (tree base, tree limit, ...@@ -671,12 +671,12 @@ 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,8 +1053,8 @@ mx_register_decls (tree decl, tree *stmt_list) ...@@ -1053,8 +1053,8 @@ 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,8 +1408,8 @@ finalize_nesting_tree_1 (struct nesting_info *root) ...@@ -1408,8 +1408,8 @@ 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,9 +1589,9 @@ maybe_fold_offset_to_array_ref (tree base, tree offset, tree orig_type) ...@@ -1589,9 +1589,9 @@ 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,8 +1969,8 @@ find_equivalent_equality_comparison (tree cond) ...@@ -1969,8 +1969,8 @@ 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);
} }
} }
return NULL; return NULL;
...@@ -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,8 +1081,8 @@ schedule_sm (struct loop *loop, edge *exits, unsigned n_exits, tree ref, ...@@ -1081,8 +1081,8 @@ 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,8 +2019,8 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt) ...@@ -2019,8 +2019,8 @@ 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);
new_temp = make_ssa_name (vec_dest, *vec_stmt); new_temp = make_ssa_name (vec_dest, *vec_stmt);
......
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