aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2007-02-19 02:45:34 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2007-02-19 02:45:34 +0000
commitb56b9fe39dc195086c6767812dead9ab424c5247 (patch)
treeb1a71a012250204314eb9f32b1e3ee95d8c2e5bb /gcc
parentda08281c06d60796e3ff5962eb4e655be1cc00ed (diff)
downloadgcc-b56b9fe39dc195086c6767812dead9ab424c5247.zip
gcc-b56b9fe39dc195086c6767812dead9ab424c5247.tar.gz
gcc-b56b9fe39dc195086c6767812dead9ab424c5247.tar.bz2
function.c (gimplify_parameters): Call build_gimple_modify_stmt instead of calling build2 with a GIMPLE_MODIFY_STMT.
* function.c (gimplify_parameters): Call build_gimple_modify_stmt instead of calling build2 with a GIMPLE_MODIFY_STMT. * gimple-low.c (lower_function_body, lower_builtin_setjmp): Likewise. * gimplify.c (build_stack_save_restore, gimplify_return_expr, gimplify_decl_expr, gimplify_self_mod_expr, gimplify_cond_expr, gimplify_init_ctor_eval_range, gimple_push_cleanup, gimplify_omp_for, gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex, gimplify_expr, gimplify_one_sizepos, force_gimple_operand): Likewise. * ipa-cp.c (constant_val_insert): Likewise. * lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression, lambda_loopnest_to_gcc_loopnest, replace_uses_equiv_to_x_with_y, perfect_nestify): Likewise. * langhooks.c (lhd_omp_assignment): Likewise. * omp-low.c (lower_rec_input_clauses, lower_reduction_clauses, lower_copyprivate_clauses, lower_send_clauses, lower_send_shared_vars, expand_parallel_call, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_omp_sections, lower_omp_single_copy, lower_omp_for_lastprivate, lower_omp_parallel, init_tmp_var, save_tmp_var): Likewise. * value-prof.c (tree_divmod_fixed_value, tree_mod_pow2, tree_mod_subtract, tree_ic, tree_stringop_fixed_value): Likewise. From-SVN: r122120
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/function.c4
-rw-r--r--gcc/gimple-low.c10
-rw-r--r--gcc/gimplify.c71
-rw-r--r--gcc/ipa-cp.c4
-rw-r--r--gcc/lambda-code.c64
-rw-r--r--gcc/langhooks.c5
-rw-r--r--gcc/omp-low.c58
-rw-r--r--gcc/value-prof.c66
9 files changed, 169 insertions, 141 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5dcfd41..677a96f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,31 @@
+2007-02-18 Roger Sayle <roger@eyesopen.com>
+
+ * function.c (gimplify_parameters): Call build_gimple_modify_stmt
+ instead of calling build2 with a GIMPLE_MODIFY_STMT.
+ * gimple-low.c (lower_function_body, lower_builtin_setjmp):
+ Likewise.
+ * gimplify.c (build_stack_save_restore, gimplify_return_expr,
+ gimplify_decl_expr, gimplify_self_mod_expr, gimplify_cond_expr,
+ gimplify_init_ctor_eval_range, gimple_push_cleanup,
+ gimplify_omp_for, gimplify_omp_atomic_pipeline,
+ gimplify_omp_atomic_mutex, gimplify_expr, gimplify_one_sizepos,
+ force_gimple_operand): Likewise.
+ * ipa-cp.c (constant_val_insert): Likewise.
+ * lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression,
+ lambda_loopnest_to_gcc_loopnest, replace_uses_equiv_to_x_with_y,
+ perfect_nestify): Likewise.
+ * langhooks.c (lhd_omp_assignment): Likewise.
+ * omp-low.c (lower_rec_input_clauses, lower_reduction_clauses,
+ lower_copyprivate_clauses, lower_send_clauses,
+ lower_send_shared_vars, expand_parallel_call,
+ expand_omp_for_generic, expand_omp_for_static_nochunk,
+ expand_omp_for_static_chunk, expand_omp_sections,
+ lower_omp_single_copy, lower_omp_for_lastprivate,
+ lower_omp_parallel, init_tmp_var, save_tmp_var): Likewise.
+ * value-prof.c (tree_divmod_fixed_value, tree_mod_pow2,
+ tree_mod_subtract, tree_ic, tree_stringop_fixed_value):
+ Likewise.
+
2007-02-19 Kazu Hirata <kazu@codesourcery.com>
* config/sh/divtab.c, config/sh/sh.c, config/sh/sh.h,
diff --git a/gcc/function.c b/gcc/function.c
index 57911be..3c62227 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3213,11 +3213,11 @@ gimplify_parameters (void)
t = built_in_decls[BUILT_IN_ALLOCA];
t = build_call_expr (t, 1, DECL_SIZE_UNIT (parm));
t = fold_convert (ptr_type, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
+ t = build_gimple_modify_stmt (addr, t);
gimplify_and_add (t, &stmts);
}
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, local, parm);
+ t = build_gimple_modify_stmt (local, parm);
gimplify_and_add (t, &stmts);
SET_DECL_VALUE_EXPR (parm, local);
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index ac5266a..642cd4f 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -1,6 +1,6 @@
/* Tree lowering pass. Lowers GIMPLE into unstructured form.
- Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -137,7 +137,7 @@ lower_function_body (void)
arg = build_addr (disp_label, current_function_decl);
t = implicit_built_in_decls[BUILT_IN_SETJMP_DISPATCHER];
t = build_call_expr (t, 1, arg);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, disp_var, t);
+ x = build_gimple_modify_stmt (disp_var, t);
/* Build 'goto DISP_VAR;' and insert. */
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
@@ -671,7 +671,8 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
/* Build 'DEST = 0' and insert. */
if (dest)
{
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, integer_zero_node);
+ t = build_gimple_modify_stmt (dest, fold_convert (TREE_TYPE (dest),
+ integer_zero_node));
SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
tsi_link_before (tsi, t, TSI_SAME_STMT);
}
@@ -694,7 +695,8 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
/* Build 'DEST = 1' and insert. */
if (dest)
{
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, integer_one_node);
+ t = build_gimple_modify_stmt (dest, fold_convert (TREE_TYPE (dest),
+ integer_one_node));
SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
tsi_link_before (tsi, t, TSI_SAME_STMT);
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2d02617..34e6249 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1043,7 +1043,7 @@ build_stack_save_restore (tree *save, tree *restore)
build_call_expr (implicit_built_in_decls[BUILT_IN_STACK_SAVE], 0);
tmp_var = create_tmp_var (ptr_type_node, "saved_stack");
- *save = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, tmp_var, save_call);
+ *save = build_gimple_modify_stmt (tmp_var, save_call);
*restore =
build_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
1, tmp_var);
@@ -1197,8 +1197,7 @@ gimplify_return_expr (tree stmt, tree *pre_p)
if (result == result_decl)
ret_expr = result;
else
- ret_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result), result_decl,
- result);
+ ret_expr = build_gimple_modify_stmt (result_decl, result);
TREE_OPERAND (stmt, 0) = ret_expr;
return GS_ALL_DONE;
@@ -1252,7 +1251,7 @@ gimplify_decl_expr (tree *stmt_p)
t = built_in_decls[BUILT_IN_ALLOCA];
t = build_call_expr (t, 1, DECL_SIZE_UNIT (decl));
t = fold_convert (ptr_type, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
+ t = build_gimple_modify_stmt (addr, t);
gimplify_and_add (t, stmt_p);
@@ -1951,7 +1950,7 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
t1 = build2 (arith_code, TREE_TYPE (*expr_p), lhs, rhs);
- t1 = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (lvalue), lvalue, t1);
+ t1 = build_gimple_modify_stmt (lvalue, t1);
if (postfix)
{
@@ -2467,14 +2466,12 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
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)
TREE_OPERAND (expr, 1)
- = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp,
- TREE_OPERAND (expr, 1));
+ = build_gimple_modify_stmt (tmp, TREE_OPERAND (expr, 1));
/* Build the else clause, 't1 = b;'. */
if (TREE_TYPE (TREE_OPERAND (expr, 2)) != void_type_node)
TREE_OPERAND (expr, 2)
- = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp2,
- TREE_OPERAND (expr, 2));
+ = build_gimple_modify_stmt (tmp2, TREE_OPERAND (expr, 2));
TREE_TYPE (expr) = void_type_node;
recalculate_side_effects (expr);
@@ -2732,7 +2729,7 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
tree *pre_p, bool cleared)
{
tree loop_entry_label, loop_exit_label;
- tree var, var_type, cref;
+ tree var, var_type, cref, tmp;
loop_entry_label = create_artificial_label ();
loop_exit_label = create_artificial_label ();
@@ -2740,8 +2737,7 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
/* Create and initialize the index variable. */
var_type = TREE_TYPE (upper);
var = create_tmp_var (var_type, NULL);
- append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var, lower),
- pre_p);
+ append_to_statement_list (build_gimple_modify_stmt (var, lower), pre_p);
/* Add the loop entry label. */
append_to_statement_list (build1 (LABEL_EXPR,
@@ -2762,9 +2758,7 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
pre_p, cleared);
else
- append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (cref),
- cref, value),
- pre_p);
+ append_to_statement_list (build_gimple_modify_stmt (cref, value), pre_p);
/* We exit the loop when the index var is equal to the upper bound. */
gimplify_and_add (build3 (COND_EXPR, void_type_node,
@@ -2777,11 +2771,9 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
pre_p);
/* Otherwise, increment the index var... */
- append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var,
- build2 (PLUS_EXPR, var_type, var,
- fold_convert (var_type,
- integer_one_node))),
- pre_p);
+ tmp = build2 (PLUS_EXPR, var_type, var,
+ fold_convert (var_type, integer_one_node));
+ append_to_statement_list (build_gimple_modify_stmt (var, tmp), pre_p);
/* ...and jump back to the loop entry. */
append_to_statement_list (build1 (GOTO_EXPR,
@@ -4240,10 +4232,8 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
*/
tree flag = create_tmp_var (boolean_type_node, "cleanup");
- tree ffalse = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
- boolean_false_node);
- tree ftrue = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
- boolean_true_node);
+ tree ffalse = build_gimple_modify_stmt (flag, boolean_false_node);
+ tree ftrue = build_gimple_modify_stmt (flag, boolean_true_node);
cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
append_to_statement_list (ffalse, &gimplify_ctxp->conditional_cleanups);
@@ -5008,14 +4998,16 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
case PREINCREMENT_EXPR:
case POSTINCREMENT_EXPR:
t = build_int_cst (TREE_TYPE (decl), 1);
- goto build_modify;
+ t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
+ t = build_gimple_modify_stmt (decl, t);
+ OMP_FOR_INCR (for_stmt) = t;
+ break;
+
case PREDECREMENT_EXPR:
case POSTDECREMENT_EXPR:
t = build_int_cst (TREE_TYPE (decl), -1);
- goto build_modify;
- build_modify:
t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, decl, t);
+ t = build_gimple_modify_stmt (decl, t);
OMP_FOR_INCR (for_stmt) = t;
break;
@@ -5229,7 +5221,7 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
return GS_ERROR;
x = build_fold_indirect_ref (addr);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
+ x = build_gimple_modify_stmt (oldval, x);
gimplify_and_add (x, pre_p);
/* For floating-point values, we'll need to view-convert them to integers
@@ -5247,7 +5239,7 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
newival = create_tmp_var (itype, NULL);
x = build1 (VIEW_CONVERT_EXPR, itype, oldval);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
+ x = build_gimple_modify_stmt (oldival, x);
gimplify_and_add (x, pre_p);
iaddr = fold_convert (build_pointer_type (itype), addr);
}
@@ -5258,32 +5250,31 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
x = build1 (LABEL_EXPR, void_type_node, label);
gimplify_and_add (x, pre_p);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newval, rhs);
+ x = build_gimple_modify_stmt (newval, rhs);
gimplify_and_add (x, pre_p);
if (newval != newival)
{
x = build1 (VIEW_CONVERT_EXPR, itype, newval);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newival, x);
+ x = build_gimple_modify_stmt (newival, x);
gimplify_and_add (x, pre_p);
}
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival2,
- fold_convert (itype, oldival));
+ x = build_gimple_modify_stmt (oldival2, fold_convert (itype, oldival));
gimplify_and_add (x, pre_p);
x = build_call_expr (cmpxchg, 3, iaddr, fold_convert (itype, oldival),
fold_convert (itype, newival));
if (oldval == oldival)
x = fold_convert (type, x);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
+ x = build_gimple_modify_stmt (oldival, x);
gimplify_and_add (x, pre_p);
/* For floating point, be prepared for the loop backedge. */
if (oldval != oldival)
{
x = build1 (VIEW_CONVERT_EXPR, type, oldival);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
+ x = build_gimple_modify_stmt (oldval, x);
gimplify_and_add (x, pre_p);
}
@@ -5321,7 +5312,7 @@ gimplify_omp_atomic_mutex (tree *expr_p, tree *pre_p, tree addr, tree rhs)
gimplify_and_add (t, pre_p);
t = build_fold_indirect_ref (addr);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, t, rhs);
+ t = build_gimple_modify_stmt (t, rhs);
gimplify_and_add (t, pre_p);
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_END];
@@ -5989,7 +5980,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
given a TREE_ADDRESSABLE type. */
tree tmp = create_tmp_var_raw (type, "vol");
gimple_add_tmp_var (tmp);
- *expr_p = build2 (GIMPLE_MODIFY_STMT, type, tmp, *expr_p);
+ *expr_p = build_gimple_modify_stmt (tmp, *expr_p);
}
else
/* We can't do anything useful with a volatile reference to
@@ -6221,7 +6212,7 @@ gimplify_one_sizepos (tree *expr_p, tree *stmt_p)
*expr_p = create_tmp_var (type, NULL);
tmp = build1 (NOP_EXPR, type, expr);
- tmp = build2 (GIMPLE_MODIFY_STMT, type, *expr_p, tmp);
+ tmp = build_gimple_modify_stmt (*expr_p, tmp);
if (EXPR_HAS_LOCATION (expr))
SET_EXPR_LOCUS (tmp, EXPR_LOCUS (expr));
else
@@ -6474,7 +6465,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
if (var)
- expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), var, expr);
+ expr = build_gimple_modify_stmt (var, expr);
ret = gimplify_expr (&expr, stmts, NULL,
gimple_test_f, fb_rvalue);
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index bd533bf..32f8b6d 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1,5 +1,5 @@
/* Interprocedural constant propagation
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Razya Ladelsky <RAZYA@il.ibm.com>
This file is part of GCC.
@@ -445,7 +445,7 @@ constant_val_insert (tree parm1, tree val)
tree init_stmt = NULL;
edge e_step;
- init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, parm1, val);
+ init_stmt = build_gimple_modify_stmt (parm1, val);
if (init_stmt)
{
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index 60e78a2..3a7fa5f 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1,5 +1,5 @@
/* Loop transformation code generation
- Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC.
@@ -1540,8 +1540,8 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
add_referenced_var (resvar);
/* Start at 0. */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- integer_zero_node);
+ stmt = build_gimple_modify_stmt (resvar,
+ fold_convert (type, integer_zero_node));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
tsi = tsi_last (stmts);
@@ -1556,8 +1556,9 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
/* newname = coefficient * induction_variable */
coeffmult = build_int_cst (type, LBV_COEFFICIENTS (lbv)[i]);
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- fold_build2 (MULT_EXPR, type, iv, coeffmult));
+ stmt = build_gimple_modify_stmt (resvar,
+ fold_build2 (MULT_EXPR, type,
+ iv, coeffmult));
newname = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
@@ -1566,8 +1567,9 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
/* name = name + newname */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (PLUS_EXPR, type, name, newname));
+ stmt = build_gimple_modify_stmt (resvar,
+ build2 (PLUS_EXPR, type,
+ name, newname));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1581,8 +1583,9 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
if (LBV_DENOMINATOR (lbv) != 1)
{
tree denominator = build_int_cst (type, LBV_DENOMINATOR (lbv));
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (CEIL_DIV_EXPR, type, name, denominator));
+ stmt = build_gimple_modify_stmt (resvar,
+ build2 (CEIL_DIV_EXPR, type,
+ name, denominator));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1632,8 +1635,8 @@ lle_to_gcc_expression (lambda_linear_expression lle,
for (; lle != NULL; lle = LLE_NEXT (lle))
{
/* Start at name = 0. */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- integer_zero_node);
+ stmt = build_gimple_modify_stmt (resvar,
+ fold_convert (type, integer_zero_node));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1664,7 +1667,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
}
/* newname = mult */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, mult);
+ stmt = build_gimple_modify_stmt (resvar, mult);
newname = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
fold_stmt (&stmt);
@@ -1672,8 +1675,9 @@ lle_to_gcc_expression (lambda_linear_expression lle,
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
/* name = name + newname */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (PLUS_EXPR, type, name, newname));
+ stmt = build_gimple_modify_stmt (resvar,
+ build2 (PLUS_EXPR, type,
+ name, newname));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1705,7 +1709,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
}
/* newname = mult */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, mult);
+ stmt = build_gimple_modify_stmt (resvar, mult);
newname = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
fold_stmt (&stmt);
@@ -1713,8 +1717,9 @@ lle_to_gcc_expression (lambda_linear_expression lle,
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
/* name = name + newname */
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (PLUS_EXPR, type, name, newname));
+ stmt = build_gimple_modify_stmt (resvar,
+ build2 (PLUS_EXPR, type,
+ name, newname));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1727,9 +1732,9 @@ lle_to_gcc_expression (lambda_linear_expression lle,
name = name + constant. */
if (LLE_CONSTANT (lle) != 0)
{
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (PLUS_EXPR, type, name,
- build_int_cst (type, LLE_CONSTANT (lle))));
+ tree incr = build_int_cst (type, LLE_CONSTANT (lle));
+ stmt = build_gimple_modify_stmt (resvar, build2 (PLUS_EXPR, type,
+ name, incr));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1741,9 +1746,9 @@ lle_to_gcc_expression (lambda_linear_expression lle,
name = name + linear offset. */
if (LLE_CONSTANT (offset) != 0)
{
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (PLUS_EXPR, type, name,
- build_int_cst (type, LLE_CONSTANT (offset))));
+ tree incr = build_int_cst (type, LLE_CONSTANT (offset));
+ stmt = build_gimple_modify_stmt (resvar, build2 (PLUS_EXPR, type,
+ name, incr));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
fold_stmt (&stmt);
@@ -1757,7 +1762,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
stmt = build_int_cst (type, LLE_DENOMINATOR (lle));
stmt = build2 (wrap == MAX_EXPR ? CEIL_DIV_EXPR : FLOOR_DIV_EXPR,
type, name, stmt);
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, stmt);
+ stmt = build_gimple_modify_stmt (resvar, stmt);
/* name = {ceil, floor}(name/denominator) */
name = make_ssa_name (resvar, stmt);
@@ -1777,8 +1782,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
{
tree op1 = VEC_index (tree, results, 0);
tree op2 = VEC_index (tree, results, 1);
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
- build2 (wrap, type, op1, op2));
+ stmt = build_gimple_modify_stmt (resvar, build2 (wrap, type, op1, op2));
name = make_ssa_name (resvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
tsi = tsi_last (stmts);
@@ -1895,8 +1899,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
test, and let redundancy elimination sort it out. */
inc_stmt = build2 (PLUS_EXPR, type,
ivvar, build_int_cst (type, LL_STEP (newloop)));
- inc_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- SSA_NAME_VAR (ivvar), inc_stmt);
+ inc_stmt = build_gimple_modify_stmt (SSA_NAME_VAR (ivvar), inc_stmt);
ivvarinced = make_ssa_name (SSA_NAME_VAR (ivvar), inc_stmt);
GIMPLE_STMT_OPERAND (inc_stmt, 0) = ivvarinced;
bsi = bsi_for_stmt (exitcond);
@@ -2187,7 +2190,7 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
add_referenced_var (var);
val = force_gimple_operand_bsi (firstbsi, val, false, NULL);
- setstmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, val);
+ setstmt = build_gimple_modify_stmt (var, val);
var = make_ssa_name (var, setstmt);
GIMPLE_STMT_OPERAND (setstmt, 0) = var;
bsi_insert_before (firstbsi, setstmt, BSI_SAME_STMT);
@@ -2535,8 +2538,7 @@ perfect_nestify (struct loop *loop,
exit_condition = get_loop_exit_condition (newloop);
uboundvar = create_tmp_var (integer_type_node, "uboundvar");
add_referenced_var (uboundvar);
- stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, uboundvar,
- VEC_index (tree, ubounds, 0));
+ stmt = build_gimple_modify_stmt (uboundvar, VEC_index (tree, ubounds, 0));
uboundvar = make_ssa_name (uboundvar, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = uboundvar;
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 5145fc3..9a33bca 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -1,5 +1,6 @@
/* Default language-specific hooks.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC.
@@ -570,7 +571,7 @@ lhd_omp_predetermined_sharing (tree decl ATTRIBUTE_UNUSED)
tree
lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src)
{
- return build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
+ return build_gimple_modify_stmt (dst, src);
}
/* Register language specific type size variables as potentially OpenMP
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index bb7ecc0..1ced1ea 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3,7 +3,7 @@
marshalling to implement data sharing and copying clauses.
Contributed by Diego Novillo <dnovillo@redhat.com>
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1675,7 +1675,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = TYPE_SIZE_UNIT (TREE_TYPE (new_var));
x = build_call_expr (built_in_decls[BUILT_IN_ALLOCA], 1, x);
x = fold_convert (TREE_TYPE (ptr), x);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ptr, x);
+ x = build_gimple_modify_stmt (ptr, x);
gimplify_and_add (x, ilist);
}
else if (is_reference (var))
@@ -1709,7 +1709,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = fold_convert (TREE_TYPE (new_var), x);
}
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
+ x = build_gimple_modify_stmt (new_var, x);
gimplify_and_add (x, ilist);
new_var = build_fold_indirect_ref (new_var);
@@ -1792,7 +1792,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
{
x = omp_reduction_init (c, TREE_TYPE (new_var));
gcc_assert (TREE_CODE (TREE_TYPE (new_var)) != ARRAY_TYPE);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
+ x = build_gimple_modify_stmt (new_var, x);
gimplify_and_add (x, ilist);
}
break;
@@ -1956,7 +1956,7 @@ lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
{
x = build2 (code, TREE_TYPE (ref), ref, new_var);
ref = build_outer_var_ref (var, ctx);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
+ x = build_gimple_modify_stmt (ref, x);
append_to_statement_list (x, &sub_list);
}
}
@@ -1993,7 +1993,7 @@ lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
ref = build_sender_ref (var, ctx);
x = (ctx->is_nested) ? lookup_decl_in_outer_ctx (var, ctx) : var;
x = by_ref ? build_fold_addr_expr (x) : x;
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
+ x = build_gimple_modify_stmt (ref, x);
gimplify_and_add (x, slist);
ref = build_receiver_ref (var, by_ref, ctx);
@@ -2074,14 +2074,14 @@ lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
{
ref = build_sender_ref (val, ctx);
x = by_ref ? build_fold_addr_expr (var) : var;
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
+ x = build_gimple_modify_stmt (ref, x);
gimplify_and_add (x, ilist);
}
if (do_out)
{
ref = build_sender_ref (val, ctx);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, ref);
+ x = build_gimple_modify_stmt (var, ref);
gimplify_and_add (x, olist);
}
}
@@ -2118,17 +2118,17 @@ lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
{
x = build_sender_ref (ovar, ctx);
var = build_fold_addr_expr (var);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
+ x = build_gimple_modify_stmt (x, var);
gimplify_and_add (x, ilist);
}
else
{
x = build_sender_ref (ovar, ctx);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
+ x = build_gimple_modify_stmt (x, var);
gimplify_and_add (x, ilist);
x = build_sender_ref (ovar, ctx);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, x);
+ x = build_gimple_modify_stmt (var, x);
gimplify_and_add (x, olist);
}
}
@@ -2226,14 +2226,14 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
si = bsi_start (then_bb);
t = build1 (LABEL_EXPR, void_type_node, then_lab);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp, val);
+ t = build_gimple_modify_stmt (tmp, val);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
si = bsi_start (else_bb);
t = build1 (LABEL_EXPR, void_type_node, else_lab);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp,
- build_int_cst (unsigned_type_node, 1));
+ t = build_gimple_modify_stmt (tmp,
+ build_int_cst (unsigned_type_node, 1));
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
@@ -2640,11 +2640,11 @@ expand_omp_for_generic (struct omp_region *region,
/* Iteration setup for sequential loop goes in L0_BB. */
list = alloc_stmt_list ();
t = fold_convert (type, istart0);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, iend0);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, iend, t);
+ t = build_gimple_modify_stmt (iend, t);
gimplify_and_add (t, &list);
si = bsi_start (l0_bb);
@@ -2666,7 +2666,7 @@ expand_omp_for_generic (struct omp_region *region,
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, iend);
@@ -2841,7 +2841,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_convert (type, s0);
t = build2 (MULT_EXPR, type, t, fd->step);
t = build2 (PLUS_EXPR, type, t, fd->n1);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, e0);
@@ -2856,7 +2856,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
@@ -3023,7 +3023,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_convert (type, s0);
t = build2 (MULT_EXPR, type, t, fd->step);
t = build2 (PLUS_EXPR, type, t, fd->n1);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, e0);
@@ -3039,7 +3039,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
+ t = build_gimple_modify_stmt (fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
@@ -3058,7 +3058,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = build_int_cst (type, 1);
t = build2 (PLUS_EXPR, type, trip, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, trip, t);
+ t = build_gimple_modify_stmt (trip, t);
gimplify_and_add (t, &list);
si = bsi_start (trip_update_bb);
@@ -3206,7 +3206,7 @@ expand_omp_sections (struct omp_region *region)
t = build_int_cst (unsigned_type_node, len);
u = built_in_decls[BUILT_IN_GOMP_SECTIONS_START];
t = build_call_expr (u, 1, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
+ t = build_gimple_modify_stmt (v, t);
bsi_insert_after (&si, t, BSI_SAME_STMT);
}
bsi_remove (&si, true);
@@ -3273,7 +3273,7 @@ expand_omp_sections (struct omp_region *region)
gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_CONTINUE);
t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT], 0);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
+ t = build_gimple_modify_stmt (v, t);
bsi_insert_after (&si, t, BSI_SAME_STMT);
bsi_remove (&si, true);
}
@@ -3709,7 +3709,7 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SINGLE_COPY_START], 0);
t = fold_convert (ptr_type, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
+ t = build_gimple_modify_stmt (ctx->receiver_decl, t);
gimplify_and_add (t, pre_p);
t = build2 (EQ_EXPR, boolean_type_node, ctx->receiver_decl,
@@ -3994,7 +3994,7 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
/* Initialize the iterator variable, so that threads that don't execute
any iterations don't execute the lastprivate clauses by accident. */
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, vinit);
+ t = build_gimple_modify_stmt (fd->v, vinit);
gimplify_and_add (t, body_p);
}
}
@@ -4134,7 +4134,7 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
t = build_fold_addr_expr (ctx->sender_decl);
/* fixup_child_record_type might have changed receiver_decl's type. */
t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
+ t = build_gimple_modify_stmt (ctx->receiver_decl, t);
append_to_statement_list (t, &new_body);
}
@@ -4186,7 +4186,7 @@ init_tmp_var (tree exp, tree_stmt_iterator *tsi)
t = create_tmp_var (TREE_TYPE (exp), NULL);
DECL_GIMPLE_REG_P (t) = 1;
- stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), t, exp);
+ stmt = build_gimple_modify_stmt (t, exp);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_before (tsi, stmt, TSI_SAME_STMT);
@@ -4203,7 +4203,7 @@ save_tmp_var (tree exp, tree_stmt_iterator *tsi)
t = create_tmp_var (TREE_TYPE (exp), NULL);
DECL_GIMPLE_REG_P (t) = 1;
- stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), exp, t);
+ stmt = build_gimple_modify_stmt (exp, t);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_after (tsi, stmt, TSI_SAME_STMT);
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 908481e..24a2171 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1,5 +1,5 @@
/* Transformations based on profile information for values.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -523,9 +523,8 @@ tree_divmod_fixed_value (tree stmt, tree operation,
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmpv,
- fold_convert (optype, value));
- stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1, op2);
+ stmt1 = build_gimple_modify_stmt (tmpv, fold_convert (optype, value));
+ stmt2 = build_gimple_modify_stmt (tmp1, op2);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
build1 (GOTO_EXPR, void_type_node, label_decl2),
@@ -537,15 +536,17 @@ tree_divmod_fixed_value (tree stmt, tree operation,
tmp2 = create_tmp_var (optype, "PROF");
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
- build2 (TREE_CODE (operation), optype, op1, tmpv));
+ stmt1 = build_gimple_modify_stmt (tmp2,
+ build2 (TREE_CODE (operation), optype,
+ op1, tmpv));
bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb2end = stmt1;
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
- build2 (TREE_CODE (operation), optype, op1, op2));
+ stmt1 = build_gimple_modify_stmt (tmp2,
+ build2 (TREE_CODE (operation), optype,
+ op1, op2));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb3end = stmt1;
@@ -680,10 +681,11 @@ tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob,
tmp2 = create_tmp_var (optype, "PROF");
tmp3 = create_tmp_var (optype, "PROF");
- stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
- build2 (PLUS_EXPR, optype, op2, build_int_cst (optype, -1)));
- stmt3 = build2 (GIMPLE_MODIFY_STMT, optype, tmp3,
- build2 (BIT_AND_EXPR, optype, tmp2, op2));
+ stmt2 = build_gimple_modify_stmt (tmp2,
+ build2 (PLUS_EXPR, optype, op2,
+ build_int_cst (optype, -1)));
+ stmt3 = build_gimple_modify_stmt (tmp3,
+ build2 (BIT_AND_EXPR, optype, tmp2, op2));
stmt4 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node,
tmp3, build_int_cst (optype, 0)),
@@ -696,15 +698,16 @@ tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob,
/* tmp2 == op2-1 inherited from previous block */
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
- build2 (BIT_AND_EXPR, optype, op1, tmp2));
+ stmt1 = build_gimple_modify_stmt (result,
+ build2 (BIT_AND_EXPR, optype, op1, tmp2));
bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb2end = stmt1;
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
- build2 (TREE_CODE (operation), optype, op1, op2));
+ stmt1 = build_gimple_modify_stmt (result,
+ build2 (TREE_CODE (operation), optype,
+ op1, op2));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb3end = stmt1;
@@ -838,8 +841,8 @@ tree_mod_subtract (tree stmt, tree operation, tree op1, tree op2,
bsi = bsi_for_stmt (stmt);
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result, op1);
- stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1, op2);
+ stmt1 = build_gimple_modify_stmt (result, op1);
+ stmt2 = build_gimple_modify_stmt (tmp1, op2);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (LT_EXPR, boolean_type_node, result, tmp1),
build1 (GOTO_EXPR, void_type_node, label_decl3),
@@ -853,8 +856,9 @@ tree_mod_subtract (tree stmt, tree operation, tree op1, tree op2,
if (ncounts) /* Assumed to be 0 or 1 */
{
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
- build2 (MINUS_EXPR, optype, result, tmp1));
+ stmt1 = build_gimple_modify_stmt (result,
+ build2 (MINUS_EXPR, optype,
+ result, tmp1));
stmt2 = build3 (COND_EXPR, void_type_node,
build2 (LT_EXPR, boolean_type_node, result, tmp1),
build1 (GOTO_EXPR, void_type_node, label_decl3),
@@ -867,8 +871,9 @@ tree_mod_subtract (tree stmt, tree operation, tree op1, tree op2,
/* Fallback case. */
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
- build2 (TREE_CODE (operation), optype, result, tmp1));
+ stmt1 = build_gimple_modify_stmt (result,
+ build2 (TREE_CODE (operation), optype,
+ result, tmp1));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb3end = stmt1;
@@ -1055,7 +1060,7 @@ tree_ic (tree stmt, tree call, struct cgraph_node* direct_call,
int prob, gcov_type count, gcov_type all)
{
tree stmt1, stmt2, stmt3;
- tree tmp1, tmpv;
+ tree tmp1, tmpv, tmp;
tree label_decl1 = create_artificial_label ();
tree label_decl2 = create_artificial_label ();
tree label1, label2;
@@ -1072,11 +1077,11 @@ tree_ic (tree stmt, tree call, struct cgraph_node* direct_call,
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmpv,
- unshare_expr (CALL_EXPR_FN (call)));
- stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1,
- fold_convert (optype, build_addr (direct_call->decl,
- current_function_decl)));
+ stmt1 = build_gimple_modify_stmt (tmpv,
+ unshare_expr (CALL_EXPR_FN (call)));
+ tmp = fold_convert (optype, build_addr (direct_call->decl,
+ current_function_decl));
+ stmt2 = build_gimple_modify_stmt (tmp1, tmp);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
build1 (GOTO_EXPR, void_type_node, label_decl2),
@@ -1279,9 +1284,8 @@ tree_stringop_fixed_value (tree stmt, tree value, int prob, gcov_type count,
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmpv,
- fold_convert (optype, value));
- stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1, blck_size);
+ stmt1 = build_gimple_modify_stmt (tmpv, fold_convert (optype, value));
+ stmt2 = build_gimple_modify_stmt (tmp1, blck_size);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
build1 (GOTO_EXPR, void_type_node, label_decl2),