+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,
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);
/* 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.
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);
/* 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);
}
/* 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);
}
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);
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;
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);
}
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)
{
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);
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 ();
/* 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,
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,
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,
*/
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);
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;
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
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);
}
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);
}
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];
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
*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
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);
/* 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.
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)
{
/* 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.
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);
/* 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;
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);
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);
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);
}
/* 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);
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);
}
/* 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);
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);
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);
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);
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);
{
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);
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);
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);
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;
/* 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.
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
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.
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))
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);
{
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;
{
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);
}
}
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);
{
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);
}
}
{
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);
}
}
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);
/* 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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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,
/* 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);
}
}
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);
}
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);
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);
/* 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.
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),
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;
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)),
/* 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;
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),
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),
/* 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;
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;
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),
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),