/* The wrapper is on the RHS of an assignment that we're pushing
down. */
gcc_assert (TREE_CODE (temp) == INIT_EXPR
- || TREE_CODE (temp) == GIMPLIFY_MODIFY_STMT
+ || TREE_CODE (temp) == GIMPLE_MODIFY_STMT
|| TREE_CODE (temp) == MODIFY_EXPR);
GENERIC_TREE_OPERAND (temp, 1) = *p;
*p = temp;
tree save_call, tmp_var;
save_call =
- build_function_call_expr (implicit_built_in_decls[BUILT_IN_STACK_SAVE],
- NULL_TREE);
+ 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_function_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
- tree_cons (NULL_TREE, tmp_var, NULL_TREE));
+ build_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
+ 1, tmp_var);
}
/* Gimplify a BIND_EXPR. Just voidify and recurse. */
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;
/* This is a variable-sized decl. Simplify its size and mark it
for deferred expansion. Note that mudflap depends on the format
of the emitted code: see mx_register_decls(). */
- tree t, args, addr, ptr_type;
+ tree t, addr, ptr_type;
gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
SET_DECL_VALUE_EXPR (decl, t);
DECL_HAS_VALUE_EXPR_P (decl) = 1;
- args = tree_cons (NULL, DECL_SIZE_UNIT (decl), NULL);
t = built_in_decls[BUILT_IN_ALLOCA];
- t = build_function_call_expr (t, args);
+ 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)
{
gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
{
tree decl;
- tree arglist;
enum gimplify_status ret;
+ int i, nargs;
gcc_assert (TREE_CODE (*expr_p) == CALL_EXPR);
decl = get_callee_fndecl (*expr_p);
if (decl && DECL_BUILT_IN (decl))
{
- tree arglist = TREE_OPERAND (*expr_p, 1);
- tree new = fold_builtin (decl, arglist, !want_value);
+ tree new = fold_call_expr (*expr_p, !want_value);
if (new && new != *expr_p)
{
if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
{
- if (!arglist || !TREE_CHAIN (arglist))
+ if (call_expr_nargs (*expr_p) < 2)
{
error ("too few arguments to function %<va_start%>");
*expr_p = build_empty_stmt ();
return GS_OK;
}
- if (fold_builtin_next_arg (TREE_CHAIN (arglist)))
+ if (fold_builtin_next_arg (*expr_p, true))
{
*expr_p = build_empty_stmt ();
return GS_OK;
}
/* Avoid gimplifying the second argument to va_start, which needs
to be the plain PARM_DECL. */
- return gimplify_arg (&TREE_VALUE (TREE_OPERAND (*expr_p, 1)), pre_p);
+ return gimplify_arg (&CALL_EXPR_ARG (*expr_p, 0), pre_p);
}
}
/* There is a sequence point before the call, so any side effects in
the calling expression must occur before the actual call. Force
gimplify_expr to use an internal post queue. */
- ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, NULL,
+ ret = gimplify_expr (&CALL_EXPR_FN (*expr_p), pre_p, NULL,
is_gimple_call_addr, fb_rvalue);
- if (PUSH_ARGS_REVERSED)
- TREE_OPERAND (*expr_p, 1) = nreverse (TREE_OPERAND (*expr_p, 1));
- for (arglist = TREE_OPERAND (*expr_p, 1); arglist;
- arglist = TREE_CHAIN (arglist))
+ nargs = call_expr_nargs (*expr_p);
+
+ for (i = (PUSH_ARGS_REVERSED ? nargs - 1 : 0);
+ PUSH_ARGS_REVERSED ? i >= 0 : i < nargs;
+ PUSH_ARGS_REVERSED ? i-- : i++)
{
enum gimplify_status t;
- t = gimplify_arg (&TREE_VALUE (arglist), pre_p);
+ t = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p);
if (t == GS_ERROR)
ret = GS_ERROR;
}
- if (PUSH_ARGS_REVERSED)
- TREE_OPERAND (*expr_p, 1) = nreverse (TREE_OPERAND (*expr_p, 1));
/* Try this again in case gimplification exposed something. */
if (ret != GS_ERROR)
{
- decl = get_callee_fndecl (*expr_p);
- if (decl && DECL_BUILT_IN (decl))
- {
- tree arglist = TREE_OPERAND (*expr_p, 1);
- tree new = fold_builtin (decl, arglist, !want_value);
+ tree new = fold_call_expr (*expr_p, !want_value);
- if (new && new != *expr_p)
- {
- /* There was a transformation of this call which computes the
- same value, but in a more efficient way. Return and try
- again. */
- *expr_p = new;
- return GS_OK;
- }
+ if (new && new != *expr_p)
+ {
+ /* There was a transformation of this call which computes the
+ same value, but in a more efficient way. Return and try
+ again. */
+ *expr_p = new;
+ return GS_OK;
}
}
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);
static enum gimplify_status
gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value)
{
- tree args, t, to, to_ptr, from;
+ tree t, to, to_ptr, from, from_ptr;
to = GENERIC_TREE_OPERAND (*expr_p, 0);
from = GENERIC_TREE_OPERAND (*expr_p, 1);
- args = tree_cons (NULL, size, NULL);
-
- t = build_fold_addr_expr (from);
- args = tree_cons (NULL, t, args);
+ from_ptr = build_fold_addr_expr (from);
to_ptr = build_fold_addr_expr (to);
- args = tree_cons (NULL, to_ptr, args);
t = implicit_built_in_decls[BUILT_IN_MEMCPY];
- t = build_function_call_expr (t, args);
+ t = build_call_expr (t, 3, to_ptr, from_ptr, size);
if (want_value)
{
static enum gimplify_status
gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value)
{
- tree args, t, to, to_ptr;
+ tree t, to, to_ptr;
to = GENERIC_TREE_OPERAND (*expr_p, 0);
- args = tree_cons (NULL, size, NULL);
-
- args = tree_cons (NULL, integer_zero_node, args);
-
to_ptr = build_fold_addr_expr (to);
- args = tree_cons (NULL, to_ptr, args);
t = implicit_built_in_decls[BUILT_IN_MEMSET];
- t = build_function_call_expr (t, args);
+ t = build_call_expr (t, 3, to_ptr, integer_zero_node, size);
if (want_value)
{
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,
return ret;
}
-/* Promote partial stores to COMPLEX variables to total stores. *EXPR_P is
- a MODIFY_EXPR with a lhs of a REAL/IMAGPART_EXPR of a variable with
- DECL_GIMPLE_REG_P set. */
-
-static enum gimplify_status
-gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
-{
- enum tree_code code, ocode;
- tree lhs, rhs, new_rhs, other, realpart, imagpart;
-
- lhs = GENERIC_TREE_OPERAND (*expr_p, 0);
- rhs = GENERIC_TREE_OPERAND (*expr_p, 1);
- code = TREE_CODE (lhs);
- lhs = TREE_OPERAND (lhs, 0);
-
- ocode = code == REALPART_EXPR ? IMAGPART_EXPR : REALPART_EXPR;
- other = build1 (ocode, TREE_TYPE (rhs), lhs);
- other = get_formal_tmp_var (other, pre_p);
-
- realpart = code == REALPART_EXPR ? rhs : other;
- imagpart = code == REALPART_EXPR ? other : rhs;
-
- if (TREE_CONSTANT (realpart) && TREE_CONSTANT (imagpart))
- new_rhs = build_complex (TREE_TYPE (lhs), realpart, imagpart);
- else
- new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
-
- GENERIC_TREE_OPERAND (*expr_p, 0) = lhs;
- GENERIC_TREE_OPERAND (*expr_p, 1) = new_rhs;
-
- if (want_value)
- {
- append_to_statement_list (*expr_p, pre_p);
- *expr_p = rhs;
- }
-
- return GS_ALL_DONE;
-}
-
-
/* Destructively convert the TREE pointer in TP into a gimple tuple if
appropriate. */
}
}
+/* Promote partial stores to COMPLEX variables to total stores. *EXPR_P is
+ a MODIFY_EXPR with a lhs of a REAL/IMAGPART_EXPR of a variable with
+ DECL_GIMPLE_REG_P set. */
+
+static enum gimplify_status
+gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
+{
+ enum tree_code code, ocode;
+ tree lhs, rhs, new_rhs, other, realpart, imagpart;
+
+ lhs = GENERIC_TREE_OPERAND (*expr_p, 0);
+ rhs = GENERIC_TREE_OPERAND (*expr_p, 1);
+ code = TREE_CODE (lhs);
+ lhs = TREE_OPERAND (lhs, 0);
+
+ ocode = code == REALPART_EXPR ? IMAGPART_EXPR : REALPART_EXPR;
+ other = build1 (ocode, TREE_TYPE (rhs), lhs);
+ other = get_formal_tmp_var (other, pre_p);
+
+ realpart = code == REALPART_EXPR ? rhs : other;
+ imagpart = code == REALPART_EXPR ? other : rhs;
+
+ if (TREE_CONSTANT (realpart) && TREE_CONSTANT (imagpart))
+ new_rhs = build_complex (TREE_TYPE (lhs), realpart, imagpart);
+ else
+ new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
+
+ GENERIC_TREE_OPERAND (*expr_p, 0) = lhs;
+ GENERIC_TREE_OPERAND (*expr_p, 1) = new_rhs;
+
+ if (want_value)
+ {
+ tree_to_gimple_tuple (expr_p);
+
+ append_to_statement_list (*expr_p, pre_p);
+ *expr_p = rhs;
+ }
+
+ return GS_ALL_DONE;
+}
+
/* Gimplify the MODIFY_EXPR node pointed to by EXPR_P.
modify_expr
*to_p = make_ssa_name (*to_p, *expr_p);
}
+ /* Try to alleviate the effects of the gimplification creating artificial
+ temporaries (see for example is_gimple_reg_rhs) on the debug info. */
+ if (!gimplify_ctxp->into_ssa
+ && DECL_P (*from_p) && DECL_IGNORED_P (*from_p)
+ && DECL_P (*to_p) && !DECL_IGNORED_P (*to_p))
+ {
+ if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
+ DECL_NAME (*from_p)
+ = create_tmp_var_name (IDENTIFIER_POINTER (DECL_NAME (*to_p)));
+ DECL_DEBUG_EXPR_IS_FROM (*from_p) = 1;
+ SET_DECL_DEBUG_EXPR (*from_p, *to_p);
+ }
+
if (want_value)
{
tree_to_gimple_tuple (expr_p);
{
tree op0 = TREE_OPERAND (*expr_p, 0);
tree op1 = TREE_OPERAND (*expr_p, 1);
- tree args, t, dest;
-
- t = TYPE_SIZE_UNIT (TREE_TYPE (op0));
- t = unshare_expr (t);
- t = SUBSTITUTE_PLACEHOLDER_IN_EXPR (t, op0);
- args = tree_cons (NULL, t, NULL);
- t = build_fold_addr_expr (op1);
- args = tree_cons (NULL, t, args);
+ tree t, arg, dest, src;
+
+ arg = TYPE_SIZE_UNIT (TREE_TYPE (op0));
+ arg = unshare_expr (arg);
+ arg = SUBSTITUTE_PLACEHOLDER_IN_EXPR (arg, op0);
+ src = build_fold_addr_expr (op1);
dest = build_fold_addr_expr (op0);
- args = tree_cons (NULL, dest, args);
t = implicit_built_in_decls[BUILT_IN_MEMCMP];
- t = build_function_call_expr (t, args);
+ t = build_call_expr (t, 3, dest, src, arg);
*expr_p
= build2 (TREE_CODE (*expr_p), TREE_TYPE (*expr_p), t, integer_zero_node);
*/
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);
fb_none);
}
if (ret == GS_ERROR)
- return GS_ERROR;
+ {
+ /* PR c++/28266 Make sure this is expanded only once. */
+ TARGET_EXPR_INITIAL (targ) = NULL_TREE;
+ return GS_ERROR;
+ }
append_to_statement_list (init, pre_p);
/* If needed, push the cleanup for the temp. */
/* We're going to make use of the TYPE_SIZE_UNIT at least in the
alloca statement we generate for the variable, so make sure it
is available. This isn't automatically needed for the SHARED
- case, since we won't be allocating local storage then. */
- else
+ case, since we won't be allocating local storage then.
+ For local variables TYPE_SIZE_UNIT might not be gimplified yet,
+ in this case omp_notice_variable will be called later
+ on when it is gimplified. */
+ else if (! (flags & GOVD_LOCAL))
omp_notice_variable (ctx, TYPE_SIZE_UNIT (TREE_TYPE (decl)), true);
}
else if (lang_hooks.decls.omp_privatize_by_reference (decl))
return !is_global_var (decl);
}
+/* Return true if DECL is private within a parallel region
+ that binds to the current construct's context or in parallel
+ region's REDUCTION clause. */
+
+static bool
+omp_check_private (struct gimplify_omp_ctx *ctx, tree decl)
+{
+ splay_tree_node n;
+
+ do
+ {
+ ctx = ctx->outer_context;
+ if (ctx == NULL)
+ return !(is_global_var (decl)
+ /* References might be private, but might be shared too. */
+ || lang_hooks.decls.omp_privatize_by_reference (decl));
+
+ n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
+ if (n != NULL)
+ return (n->value & GOVD_SHARED) == 0;
+ }
+ while (!ctx->is_parallel);
+ return false;
+}
+
/* Scan the OpenMP clauses in *LIST_P, installing mappings into a new
and previous omp contexts. */
enum gimplify_status gs;
bool remove = false;
bool notice_outer = true;
+ const char *check_non_private = NULL;
unsigned int flags;
tree decl;
goto do_add;
case OMP_CLAUSE_FIRSTPRIVATE:
flags = GOVD_FIRSTPRIVATE | GOVD_EXPLICIT;
+ check_non_private = "firstprivate";
goto do_add;
case OMP_CLAUSE_LASTPRIVATE:
flags = GOVD_LASTPRIVATE | GOVD_SEEN | GOVD_EXPLICIT;
+ check_non_private = "lastprivate";
goto do_add;
case OMP_CLAUSE_REDUCTION:
flags = GOVD_REDUCTION | GOVD_SEEN | GOVD_EXPLICIT;
+ check_non_private = "reduction";
goto do_add;
do_add:
remove = true;
break;
}
- /* Handle NRV results passed by reference. */
- if (TREE_CODE (decl) == INDIRECT_REF
- && TREE_CODE (TREE_OPERAND (decl, 0)) == RESULT_DECL
- && DECL_BY_REFERENCE (TREE_OPERAND (decl, 0)))
- OMP_CLAUSE_DECL (c) = decl = TREE_OPERAND (decl, 0);
omp_add_variable (ctx, decl, flags);
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
remove = true;
break;
}
- /* Handle NRV results passed by reference. */
- if (TREE_CODE (decl) == INDIRECT_REF
- && TREE_CODE (TREE_OPERAND (decl, 0)) == RESULT_DECL
- && DECL_BY_REFERENCE (TREE_OPERAND (decl, 0)))
- OMP_CLAUSE_DECL (c) = decl = TREE_OPERAND (decl, 0);
do_notice:
if (outer_ctx)
omp_notice_variable (outer_ctx, decl, true);
+ if (check_non_private
+ && !in_parallel
+ && omp_check_private (ctx, decl))
+ {
+ error ("%s variable %qs is private in outer context",
+ check_non_private, IDENTIFIER_POINTER (DECL_NAME (decl)));
+ remove = true;
+ }
break;
case OMP_CLAUSE_IF:
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;
gimplify_omp_atomic_fetch_op (tree *expr_p, tree addr, tree rhs, int index)
{
enum built_in_function base;
- tree decl, args, itype;
+ tree decl, itype;
enum insn_code *optab;
/* Check for one of the supported fetch-op operations. */
if (optab[TYPE_MODE (itype)] == CODE_FOR_nothing)
return GS_UNHANDLED;
- args = tree_cons (NULL, fold_convert (itype, rhs), NULL);
- args = tree_cons (NULL, addr, args);
- *expr_p = build_function_call_expr (decl, args);
+ *expr_p = build_call_expr (decl, 2, addr, fold_convert (itype, rhs));
return GS_OK;
}
tree rhs, int index)
{
tree oldval, oldival, oldival2, newval, newival, label;
- tree type, itype, cmpxchg, args, x, iaddr;
+ tree type, itype, cmpxchg, x, iaddr;
cmpxchg = built_in_decls[BUILT_IN_VAL_COMPARE_AND_SWAP_N + index + 1];
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (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
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);
- args = tree_cons (NULL, fold_convert (itype, newival), NULL);
- args = tree_cons (NULL, fold_convert (itype, oldival), args);
- args = tree_cons (NULL, iaddr, args);
- x = build_function_call_expr (cmpxchg, args);
+ 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);
}
tree t;
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_START];
- t = build_function_call_expr (t, NULL);
+ t = build_call_expr (t, 0);
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];
- t = build_function_call_expr (t, NULL);
+ t = build_call_expr (t, 0);
gimplify_and_add (t, pre_p);
*expr_p = NULL;
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
x = DECL_SAVED_TREE (fndecl);
append_to_statement_list (x, &TREE_OPERAND (tf, 0));
x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT];
- x = build_function_call_expr (x, NULL);
+ x = build_call_expr (x, 0);
append_to_statement_list (x, &TREE_OPERAND (tf, 1));
bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
TREE_SIDE_EFFECTS (bind) = 1;
x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER];
- x = build_function_call_expr (x, NULL);
+ x = build_call_expr (x, 0);
append_to_statement_list (x, &BIND_EXPR_BODY (bind));
append_to_statement_list (tf, &BIND_EXPR_BODY (bind));
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);