+2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * auto-inc-dec.c (reverse_mem, reverse_inc): Remove.
+ (parse_add_or_inc): Use std::swap instead of reverse_{mem,inc}.
+ (find_inc): Likewise.
+ * combine.c (combine_simplify_rtx): Use std::swap instead of manually
+ swapping.
+ * df-core.c (df_worklist_dataflow_doublequeue): Likewise.
+ * df-scan.c (df_swap_refs): Remove.
+ (df_sort_and_compress_refs): Use std::swap instead of df_swap_refs.
+ * dominance.c (link_roots): Use std::swap instead of manually swapping.
+ * expr.c (expand_expr_real_2, do_store_flag): Likewise.
+ * fold-const.c (fold_relational_const): Likewise.
+ * genattrtab.c (simplify_test_exp): Likewise.
+ * gimple-match-head.c (gimple_resimplify2, gimple_resimplify3,
+ gimple_simplify): Likewise.
+ * ifcvt.c (noce_try_abs, find_if_header): Likewise.
+ * internal-fn.c (expand_addsub_overflow, expand_mul_overflow): Likewise.
+ * ipa-devirt.c (add_type_duplicate): Likewise.
+ * loop-iv.c (get_biv_step_1, iv_number_of_iterations): Likewise.
+ * lra-lives.c (lra_setup_reload_pseudo_preferenced_hard_reg): Likewise.
+ * lra.c (lra_create_copy): Likewise.
+ * lto-streamer-out.c (DFS::DFS): Likewise.
+ * modulo-sched.c (get_sched_window): Likewise.
+ * omega.c (omega_pretty_print_problem): Likewise.
+ * optabs.c (prepare_float_lib_cmp, expand_mult_highpart): Likewise.
+ * reload1.c (reloads_unique_chain_p): Likewise.
+ * sel-sched-ir.c (exchange_lv_sets, exchange_av_sets): Remove.
+ (exchange_data_sets): Move logic from exchange_{av,lv}_sets here and
+ use std::swap.
+ * simplify-rtx.c (simplify_unary_operation_1): Use std::swap instead of
+ manually swapping.
+ * tree-if-conv.c (is_cond_scalar_reduction, predicate_scalar_phi,
+ predicate_mem_writes): Likewise.
+ * tree-loop-distribution.c (pg_add_dependence_edges): Likewise.
+ * tree-predcom.c (combine_chains): Likewise.
+ * tree-ssa-alias.c (nonoverlapping_component_refs_p,
+ refs_may_alias_p_1): Likewise.
+ * tree-ssa-ifcombine.c (recognize_if_then_else): Likewise.
+ * tree-ssa-loop-ivopts.c (extract_cond_operands): Likewise.
+ * tree-ssa-loop-niter.c (refine_bounds_using_guard,
+ number_of_iterations_cond): Likewise.
+ * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise.
+ * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise.
+ * tree-vect-slp.c (vect_build_slp_tree): Likewise.
+ * tree-vect-stmts.c (supportable_widening_operation): Likewise.
+ * tree-vrp.c (extract_range_from_binary_expr_1,
+ extract_range_from_unary_expr_1): Likewise.
+
2015-06-20 Marek Polacek <polacek@redhat.com>
* common.opt (fsanitize-undefined-trap-on-error): Add Driver.
}
-/* Reverse the operands in a mem insn. */
-
-static void
-reverse_mem (void)
-{
- rtx tmp = mem_insn.reg1;
- mem_insn.reg1 = mem_insn.reg0;
- mem_insn.reg0 = tmp;
-}
-
-
-/* Reverse the operands in a inc insn. */
-
-static void
-reverse_inc (void)
-{
- rtx tmp = inc_insn.reg1;
- inc_insn.reg1 = inc_insn.reg0;
- inc_insn.reg0 = tmp;
-}
-
-
/* Return true if INSN is of a form "a = b op c" where a and b are
regs. op is + if c is a reg and +|- if c is a const. Fill in
INC_INSN with what is found.
{
/* Reverse the two operands and turn *_ADD into *_INC since
a = c + a. */
- reverse_inc ();
+ std::swap (inc_insn.reg0, inc_insn.reg1);
inc_insn.form = before_mem ? FORM_PRE_INC : FORM_POST_INC;
return true;
}
find this. Only try it once though. */
if (first_try && !mem_insn.reg1_is_const)
{
- reverse_mem ();
+ std::swap (mem_insn.reg0, mem_insn.reg1);
return find_inc (false);
}
else
return false;
if (!rtx_equal_p (mem_insn.reg0, inc_insn.reg0))
- reverse_inc ();
+ std::swap (inc_insn.reg0, inc_insn.reg1);
}
other_insn
/* See comment above on find_inc (false) call. */
if (first_try)
{
- reverse_mem ();
+ std::swap (mem_insn.reg0, mem_insn.reg1);
return find_inc (false);
}
else
{
/* We know that mem_insn.reg0 must equal inc_insn.reg1
or else we would not have found the inc insn. */
- reverse_mem ();
+ std::swap (mem_insn.reg0, mem_insn.reg1);
if (!rtx_equal_p (mem_insn.reg0, inc_insn.reg0))
{
/* See comment above on find_inc (false) call. */
{
if (first_try)
{
- reverse_mem ();
+ std::swap (mem_insn.reg0, mem_insn.reg1);
return find_inc (false);
}
else
+2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * c-common.c (scalar_to_vector): Use std::swap instead of manually
+ swapping.
+
2015-06-17 Andrew MacLeod <amacleod@redhat.com>
* array-notation-common.c: Do not include input.h, line-map.h or is-a.h.
/* What about UNLT_EXPR? */
if (TREE_CODE (type0) == VECTOR_TYPE)
{
- tree tmp;
ret = stv_secondarg;
- /* Swap TYPE0 with TYPE1 and OP0 with OP1 */
- tmp = type0; type0 = type1; type1 = tmp;
- tmp = op0; op0 = op1; op1 = tmp;
+ std::swap (type0, type1);
+ std::swap (op0, op1);
}
if (TREE_CODE (type0) == INTEGER_TYPE
/* Make sure we pass the constant operand if any as the second
one if this is a commutative operation. */
if (CONSTANT_P (inner_op0) && COMMUTATIVE_ARITH_P (x))
- {
- rtx tem = inner_op0;
- inner_op0 = inner_op1;
- inner_op1 = tem;
- }
+ std::swap (inner_op0, inner_op1);
inner = simplify_binary_operation (code == MINUS ? PLUS
: code == DIV ? MULT
: code,
+2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of
+ manually swapping.
+ * semantics.c (finish_omp_atomic): Likewise.
+ * typeck.c (cp_build_array_ref): Likewise.
+
2015-06-20 Mikhail Maltsev <maltsevm@gmail.com>
PR c++/65882
break;
case DEDUCE_CONV:
- {
- /* Swap PARM and ARG throughout the remainder of this
- function; the handling is precisely symmetric since PARM
- will initialize ARG rather than vice versa. */
- tree* temp = parm;
- parm = arg;
- arg = temp;
- break;
- }
+ /* Swap PARM and ARG throughout the remainder of this
+ function; the handling is precisely symmetric since PARM
+ will initialize ARG rather than vice versa. */
+ std::swap (parm, arg);
+ break;
case DEDUCE_EXACT:
/* Core issue #873: Do the DR606 thing (see below) for these cases,
bool swapped = false;
if (rhs1 && cp_tree_equal (lhs, rhs))
{
- tree tem = rhs;
- rhs = rhs1;
- rhs1 = tem;
+ std::swap (rhs, rhs1);
swapped = !commutative_tree_code (opcode);
}
if (rhs1 && !cp_tree_equal (lhs, rhs1))
/* Put the integer in IND to simplify error checking. */
if (TREE_CODE (TREE_TYPE (ar)) == INTEGER_TYPE)
- {
- tree temp = ar;
- ar = ind;
- ind = temp;
- }
+ std::swap (ar, ind);
if (ar == error_mark_node || ind == error_mark_node)
return error_mark_node;
bitmap_iterator bi;
unsigned int index;
- /* Swap pending and worklist. */
- bitmap temp = worklist;
- worklist = pending;
- pending = temp;
+ std::swap (pending, worklist);
EXECUTE_IF_SET_IN_BITMAP (worklist, 0, index, bi)
{
return df_ref_compare (*(const df_ref *) r1, *(const df_ref *) r2);
}
-static void
-df_swap_refs (vec<df_ref, va_heap> *ref_vec, int i, int j)
-{
- df_ref tmp = (*ref_vec)[i];
- (*ref_vec)[i] = (*ref_vec)[j];
- (*ref_vec)[j] = tmp;
-}
-
/* Sort and compress a set of refs. */
static void
df_ref r0 = (*ref_vec)[0];
df_ref r1 = (*ref_vec)[1];
if (df_ref_compare (r0, r1) > 0)
- df_swap_refs (ref_vec, 0, 1);
+ std::swap ((*ref_vec)[0], (*ref_vec)[1]);
}
else
{
di->path_min[s] = di->path_min[w];
di->set_size[v] += di->set_size[w];
if (di->set_size[v] < 2 * di->set_size[w])
- {
- TBB tmp = s;
- s = di->set_child[v];
- di->set_child[v] = tmp;
- }
+ std::swap (di->set_child[v], s);
/* Merge all subtrees. */
while (s)
Thus the following special case checks need only
check the second operand. */
if (TREE_CODE (treeop0) == INTEGER_CST)
- {
- tree t1 = treeop0;
- treeop0 = treeop1;
- treeop1 = t1;
- }
+ std::swap (treeop0, treeop1);
/* First, check if we have a multiplication of one signed and one
unsigned operand. */
def0 = get_def_for_expr (treeop1, NEGATE_EXPR);
/* Swap operands if the 2nd operand is fed by a negate. */
if (def0)
- {
- tree tem = treeop0;
- treeop0 = treeop1;
- treeop1 = tem;
- }
+ std::swap (treeop0, treeop1);
}
def2 = get_def_for_expr (treeop2, NEGATE_EXPR);
Thus the following special case checks need only
check the second operand. */
if (TREE_CODE (treeop0) == INTEGER_CST)
- {
- tree t1 = treeop0;
- treeop0 = treeop1;
- treeop1 = t1;
- }
+ std::swap (treeop0, treeop1);
/* Attempt to return something suitable for generating an
indexed address, for machines that support that. */
{
enum rtx_code code;
tree arg0, arg1, type;
- tree tem;
machine_mode operand_mode;
int unsignedp;
rtx op0, op1;
if (TREE_CODE (arg0) == REAL_CST || TREE_CODE (arg0) == INTEGER_CST
|| TREE_CODE (arg0) == FIXED_CST)
{
- tem = arg0; arg0 = arg1; arg1 = tem;
+ std::swap (arg0, arg1);
code = swap_condition (code);
}
if (code == LE_EXPR || code == GT_EXPR)
{
- tree tem = op0;
- op0 = op1;
- op1 = tem;
+ std::swap (op0, op1);
code = swap_tree_comparison (code);
}
&& compute_alternative_mask (right, IOR))
{
if (GET_CODE (left) == IOR)
- {
- rtx tem = left;
- left = right;
- right = tem;
- }
+ std::swap (left, right);
newexp = attr_rtx (IOR,
attr_rtx (AND, left, XEXP (right, 0)),
|| commutative_tree_code (*res_code))
&& tree_swap_operands_p (res_ops[0], res_ops[1], false))
{
- tree tem = res_ops[0];
- res_ops[0] = res_ops[1];
- res_ops[1] = tem;
+ std::swap (res_ops[0], res_ops[1]);
if (TREE_CODE_CLASS ((enum tree_code) *res_code) == tcc_comparison)
*res_code = swap_tree_comparison (*res_code);
canonicalized = true;
&& commutative_ternary_tree_code (*res_code)
&& tree_swap_operands_p (res_ops[0], res_ops[1], false))
{
- tree tem = res_ops[0];
- res_ops[0] = res_ops[1];
- res_ops[1] = tem;
+ std::swap (res_ops[0], res_ops[1]);
canonicalized = true;
}
|| TREE_CODE_CLASS (code) == tcc_comparison)
&& tree_swap_operands_p (op0, op1, false))
{
- tree tem = op0;
- op0 = op1;
- op1 = tem;
+ std::swap (op0, op1);
if (TREE_CODE_CLASS (code) == tcc_comparison)
code = swap_tree_comparison (code);
}
generation. */
if (commutative_ternary_tree_code (code)
&& tree_swap_operands_p (op0, op1, false))
- {
- tree tem = op0;
- op0 = op1;
- op1 = tem;
- }
+ std::swap (op0, op1);
code_helper rcode;
tree ops[3] = {};
negate = 0;
else if (GET_CODE (b) == NEG && rtx_equal_p (XEXP (b, 0), a))
{
- c = a; a = b; b = c;
+ std::swap (a, b);
negate = 1;
}
else if (GET_CODE (a) == NOT && rtx_equal_p (XEXP (a, 0), b))
}
else if (GET_CODE (b) == NOT && rtx_equal_p (XEXP (b, 0), a))
{
- c = a; a = b; b = c;
+ std::swap (a, b);
negate = 1;
one_cmpl = true;
}
if (then_edge->flags & EDGE_FALLTHRU)
;
else if (else_edge->flags & EDGE_FALLTHRU)
- {
- edge e = else_edge;
- else_edge = then_edge;
- then_edge = e;
- }
+ std::swap (then_edge, else_edge);
else
/* Otherwise this must be a multiway branch of some sort. */
return NULL;
/* PLUS_EXPR is commutative, if operand signedness differs,
canonicalize to the first operand being signed and second
unsigned to simplify following code. */
- rtx tem = op1;
- op1 = op0;
- op0 = tem;
- tree t = arg1;
- arg1 = arg0;
- arg0 = t;
- uns0_p = 0;
- uns1_p = 1;
+ std::swap (op0, op1);
+ std::swap (arg0, arg1);
+ uns0_p = false;
+ uns1_p = true;
}
/* u1 +- u2 -> ur */
int pos_neg0 = get_range_pos_neg (arg0);
if (pos_neg0 != 3 && pos_neg == 3)
{
- rtx tem = op1;
- op1 = op0;
- op0 = tem;
+ std::swap (op0, op1);
pos_neg = pos_neg0;
}
}
do_compare_rtx_and_jump will be just folded. Otherwise try
to use range info if available. */
if (code == PLUS_EXPR && CONST_INT_P (op0))
- {
- rtx tem = op0;
- op0 = op1;
- op1 = tem;
- }
+ std::swap (op0, op1);
else if (CONST_INT_P (op1))
;
else if (code == PLUS_EXPR && TREE_CODE (arg0) == SSA_NAME)
{
pos_neg = get_range_pos_neg (arg0);
if (pos_neg != 3)
- {
- rtx tem = op0;
- op0 = op1;
- op1 = tem;
- }
+ std::swap (op0, op1);
}
if (pos_neg == 3 && !CONST_INT_P (op1) && TREE_CODE (arg1) == SSA_NAME)
pos_neg = get_range_pos_neg (arg1);
/* Multiplication is commutative, if operand signedness differs,
canonicalize to the first operand being signed and second
unsigned to simplify following code. */
- rtx tem = op1;
- op1 = op0;
- op0 = tem;
- tree t = arg1;
- arg1 = arg0;
- arg0 = t;
- uns0_p = 0;
- uns1_p = 1;
+ std::swap (op0, op1);
+ std::swap (arg0, arg1);
+ uns0_p = false;
+ uns1_p = true;
}
int pos_neg0 = get_range_pos_neg (arg0);
}
if (prevail)
- {
- tree tmp = type;
-
- type = val->type;
- val->type = tmp;
- }
+ std::swap (val->type, type);
val->types_set->add (type);
rtx *outer_step)
{
rtx set, rhs, op0 = NULL_RTX, op1 = NULL_RTX;
- rtx next, nextr, tmp;
+ rtx next, nextr;
enum rtx_code code;
rtx_insn *insn = DF_REF_INSN (def);
df_ref next_def;
op1 = XEXP (rhs, 1);
if (code == PLUS && CONSTANT_P (op0))
- {
- tmp = op0; op0 = op1; op1 = tmp;
- }
+ std::swap (op0, op1);
if (!simple_reg_p (op0)
|| !CONSTANT_P (op1))
struct niter_desc *desc)
{
rtx op0, op1, delta, step, bound, may_xform, tmp, tmp0, tmp1;
- struct rtx_iv iv0, iv1, tmp_iv;
+ struct rtx_iv iv0, iv1;
rtx assumption, may_not_xform;
enum rtx_code cond;
machine_mode mode, comp_mode;
case GT:
case GEU:
case GTU:
- tmp_iv = iv0; iv0 = iv1; iv1 = tmp_iv;
+ std::swap (iv0, iv1);
cond = swap_condition (cond);
break;
case NE:
&& (lra_reg_info[regno].preferred_hard_regno_profit2
> lra_reg_info[regno].preferred_hard_regno_profit1))
{
- int temp;
-
- temp = lra_reg_info[regno].preferred_hard_regno1;
- lra_reg_info[regno].preferred_hard_regno1
- = lra_reg_info[regno].preferred_hard_regno2;
- lra_reg_info[regno].preferred_hard_regno2 = temp;
- temp = lra_reg_info[regno].preferred_hard_regno_profit1;
- lra_reg_info[regno].preferred_hard_regno_profit1
- = lra_reg_info[regno].preferred_hard_regno_profit2;
- lra_reg_info[regno].preferred_hard_regno_profit2 = temp;
+ std::swap (lra_reg_info[regno].preferred_hard_regno1,
+ lra_reg_info[regno].preferred_hard_regno2);
+ std::swap (lra_reg_info[regno].preferred_hard_regno_profit1,
+ lra_reg_info[regno].preferred_hard_regno_profit2);
}
if (lra_dump_file != NULL)
{
regno1_dest_p = true;
if (regno1 > regno2)
{
- int temp = regno2;
-
+ std::swap (regno1, regno2);
regno1_dest_p = false;
- regno2 = regno1;
- regno1 = temp;
}
cp = new lra_copy ();
copy_vec.safe_push (cp);
}
}
for (unsigned i = 0; i < scc_entry_len; ++i)
- {
- scc_entry tem = sccstack[first + i];
- sccstack[first + i] = sccstack[first + entry_start + i];
- sccstack[first + entry_start + i] = tem;
- }
+ std::swap (sccstack[first + i],
+ sccstack[first + entry_start + i]);
if (scc_entry_len == 1)
; /* We already sorted SCC deterministically in hash_scc. */
node close to its successors. */
if (pss_not_empty && count_succs >= count_preds)
{
- int tmp = end;
- end = start;
- start = tmp;
+ std::swap (start, end);
step = -1;
}
else
{
if (pb->geqs[e].coef[v1] == 1)
- {
- v3 = v2;
- v2 = v1;
- v1 = v3;
- }
+ std::swap (v1, v2);
/* Relation is v1 <= v2 or v1 < v2. */
po[v1][v2] = ((pb->geqs[e].coef[0] == 0) ? le : lt);
if (code_to_optab (swapped)
&& (libfunc = optab_libfunc (code_to_optab (swapped), mode)))
{
- rtx tmp;
- tmp = x; x = y; y = tmp;
+ std::swap (x, y);
comparison = swapped;
break;
}
tab1 = uns_p ? vec_widen_umult_lo_optab : vec_widen_smult_lo_optab;
tab2 = uns_p ? vec_widen_umult_hi_optab : vec_widen_smult_hi_optab;
if (BYTES_BIG_ENDIAN)
- {
- optab t = tab1;
- tab1 = tab2;
- tab2 = t;
- }
+ std::swap (tab1, tab2);
break;
default:
gcc_unreachable ();
/* The following loop assumes that r1 is the reload that feeds r2. */
if (r1 > r2)
- {
- int tmp = r2;
- r2 = r1;
- r1 = tmp;
- }
+ std::swap (r1, r2);
for (i = 0; i < n_reloads; i ++)
/* Look for input reloads that aren't our two */
free_av_set (bb);
}
-/* Exchange lv sets of TO and FROM. */
-static void
-exchange_lv_sets (basic_block to, basic_block from)
-{
- {
- regset to_lv_set = BB_LV_SET (to);
-
- BB_LV_SET (to) = BB_LV_SET (from);
- BB_LV_SET (from) = to_lv_set;
- }
-
- {
- bool to_lv_set_valid_p = BB_LV_SET_VALID_P (to);
-
- BB_LV_SET_VALID_P (to) = BB_LV_SET_VALID_P (from);
- BB_LV_SET_VALID_P (from) = to_lv_set_valid_p;
- }
-}
-
-
-/* Exchange av sets of TO and FROM. */
-static void
-exchange_av_sets (basic_block to, basic_block from)
-{
- {
- av_set_t to_av_set = BB_AV_SET (to);
-
- BB_AV_SET (to) = BB_AV_SET (from);
- BB_AV_SET (from) = to_av_set;
- }
-
- {
- int to_av_level = BB_AV_LEVEL (to);
-
- BB_AV_LEVEL (to) = BB_AV_LEVEL (from);
- BB_AV_LEVEL (from) = to_av_level;
- }
-}
-
/* Exchange data sets of TO and FROM. */
void
exchange_data_sets (basic_block to, basic_block from)
{
- exchange_lv_sets (to, from);
- exchange_av_sets (to, from);
+ /* Exchange lv sets of TO and FROM. */
+ std::swap (BB_LV_SET (from), BB_LV_SET (to));
+ std::swap (BB_LV_SET_VALID_P (from), BB_LV_SET_VALID_P (to));
+
+ /* Exchange av sets of TO and FROM. */
+ std::swap (BB_AV_SET (from), BB_AV_SET (to));
+ std::swap (BB_AV_LEVEL (from), BB_AV_LEVEL (to));
}
/* Copy data sets of FROM to TO. */
in2 = simplify_gen_unary (NOT, op_mode, in2, op_mode);
if (GET_CODE (in2) == NOT && GET_CODE (in1) != NOT)
- {
- rtx tem = in2;
- in2 = in1; in1 = tem;
- }
+ std::swap (in1, in2);
return gen_rtx_fmt_ee (GET_CODE (op) == IOR ? AND : IOR,
mode, in1, in2);
/* Make R_OP1 to hold reduction variable. */
if (r_op2 == PHI_RESULT (header_phi)
&& reduction_op == PLUS_EXPR)
- {
- tree tmp = r_op1;
- r_op1 = r_op2;
- r_op2 = tmp;
- }
+ std::swap (r_op1, r_op2);
else if (r_op1 != PHI_RESULT (header_phi))
return false;
second_edge = EDGE_PRED (bb, 1);
cond = bb_predicate (first_edge->src);
if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
- {
- edge tmp_edge = first_edge;
- first_edge = second_edge;
- second_edge = tmp_edge;
- }
+ std::swap (first_edge, second_edge);
if (EDGE_COUNT (first_edge->src->succs) > 1)
{
cond = bb_predicate (second_edge->src);
/* Put element with max number of occurences to the end of ARGS. */
if (max_ind != -1 && max_ind +1 != (int) args_len)
- {
- tree tmp = args[args_len - 1];
- args[args_len - 1] = args[max_ind];
- args[max_ind] = tmp;
- }
+ std::swap (args[args_len - 1], args[max_ind]);
/* Handle one special case when number of arguments with different values
is equal 2 and one argument has the only occurrence. Such PHI can be
lhs = ifc_temp_var (type, unshare_expr (lhs), &gsi);
rhs = ifc_temp_var (type, unshare_expr (rhs), &gsi);
if (swap)
- {
- tree tem = lhs;
- lhs = rhs;
- rhs = tem;
- }
+ std::swap (lhs, rhs);
cond = force_gimple_operand_gsi_1 (&gsi, unshare_expr (cond),
is_gimple_condexpr, NULL_TREE,
true, GSI_SAME_STMT);
if (rdg_vertex_for_stmt (rdg, DR_STMT (dr1))
> rdg_vertex_for_stmt (rdg, DR_STMT (dr2)))
{
- data_reference_p tem = dr1;
- dr1 = dr2;
- dr2 = tem;
+ std::swap (dr1, dr2);
this_dir = -this_dir;
}
ddr = initialize_data_dependence_relation (dr1, dr2, loops);
{
if (DDR_REVERSED_P (ddr))
{
- data_reference_p tem = dr1;
- dr1 = dr2;
- dr2 = tem;
+ std::swap (dr1, dr2);
this_dir = -this_dir;
}
/* Known dependences can still be unordered througout the
}
if (swap)
- {
- chain_p tmp = ch1;
- ch1 = ch2;
- ch2 = tmp;
- }
+ std::swap (ch1, ch2);
new_chain = XCNEW (struct chain);
new_chain->type = CT_COMBINATION;
if (fieldsx.length () == 2)
{
if (ncr_compar (&fieldsx[0], &fieldsx[1]) == 1)
- {
- const_tree tem = fieldsx[0];
- fieldsx[0] = fieldsx[1];
- fieldsx[1] = tem;
- }
+ std::swap (fieldsx[0], fieldsx[1]);
}
else
fieldsx.qsort (ncr_compar);
if (fieldsy.length () == 2)
{
if (ncr_compar (&fieldsy[0], &fieldsy[1]) == 1)
- {
- const_tree tem = fieldsy[0];
- fieldsy[0] = fieldsy[1];
- fieldsy[1] = tem;
- }
+ std::swap (fieldsy[0], fieldsy[1]);
}
else
fieldsy.qsort (ncr_compar);
/* Canonicalize the pointer-vs-decl case. */
if (ind1_p && var2_p)
{
- HOST_WIDE_INT tmp1;
- tree tmp2;
- ao_ref *tmp3;
- tmp1 = offset1; offset1 = offset2; offset2 = tmp1;
- tmp1 = max_size1; max_size1 = max_size2; max_size2 = tmp1;
- tmp2 = base1; base1 = base2; base2 = tmp2;
- tmp3 = ref1; ref1 = ref2; ref2 = tmp3;
+ std::swap (offset1, offset2);
+ std::swap (max_size1, max_size2);
+ std::swap (base1, base2);
+ std::swap (ref1, ref2);
var1_p = true;
ind1_p = false;
var2_p = false;
t = EDGE_SUCC (cond_bb, 0);
e = EDGE_SUCC (cond_bb, 1);
if (!(t->flags & EDGE_TRUE_VALUE))
- {
- edge tmp = t;
- t = e;
- e = tmp;
- }
+ std::swap (t, e);
if (!(t->flags & EDGE_TRUE_VALUE)
|| !(e->flags & EDGE_FALSE_VALUE))
return false;
/* The objects returned when COND has constant operands. */
static struct iv const_iv;
static tree zero;
- tree *op0 = &zero, *op1 = &zero, *tmp_op;
- struct iv *iv0 = &const_iv, *iv1 = &const_iv, *tmp_iv;
+ tree *op0 = &zero, *op1 = &zero;
+ struct iv *iv0 = &const_iv, *iv1 = &const_iv;
bool ret = false;
if (gimple_code (stmt) == GIMPLE_COND)
if (integer_zerop (iv0->step))
{
/* Control variable may be on the other side. */
- tmp_op = op0; op0 = op1; op1 = tmp_op;
- tmp_iv = iv0; iv0 = iv1; iv1 = tmp_iv;
+ std::swap (op0, op1);
+ std::swap (iv0, iv1);
}
ret = !integer_zerop (iv0->step) && integer_zerop (iv1->step);
#include "wide-int-print.h"
-#define SWAP(X, Y) do { affine_iv *tmp = (X); (X) = (Y); (Y) = tmp; } while (0)
-
/* The maximum number of dominator BBs we search for conditions
of loop header copies we use for simplifying a conditional
expression. */
tree c0, enum tree_code cmp, tree c1,
bounds *bnds)
{
- tree varc0, varc1, tmp, ctype;
+ tree varc0, varc1, ctype;
mpz_t offc0, offc1, loffx, loffy, bnd;
bool lbound = false;
bool no_wrap = nowrap_type_p (type);
if (operand_equal_p (varx, varc1, 0))
{
- tmp = varc0; varc0 = varc1; varc1 = tmp;
+ std::swap (varc0, varc1);
mpz_swap (offc0, offc1);
cmp = swap_tree_comparison (cmp);
}
if (cmp == GT_EXPR || cmp == GE_EXPR)
{
- tmp = varx; varx = vary; vary = tmp;
+ std::swap (varx, vary);
mpz_swap (offc0, offc1);
mpz_swap (loffx, loffy);
cmp = swap_tree_comparison (cmp);
if (code == GE_EXPR || code == GT_EXPR
|| (code == NE_EXPR && integer_zerop (iv0->step)))
{
- SWAP (iv0, iv1);
+ std::swap (iv0, iv1);
code = swap_tree_comparison (code);
}
;
else if (EDGE_SUCC (bb2, 0)->dest == bb1)
{
- basic_block bb_tmp = bb1;
- edge e_tmp = e1;
- bb1 = bb2;
- bb2 = bb_tmp;
- e1 = e2;
- e2 = e_tmp;
+ std::swap (bb1, bb2);
+ std::swap (e1, e2);
}
else if (do_store_elim
&& EDGE_SUCC (bb1, 0)->dest == EDGE_SUCC (bb2, 0)->dest)
if (vno1->length == 2
&& commutative_tree_code (vno1->opcode)
&& tree_swap_operands_p (vno1->op[0], vno1->op[1], false))
- {
- tree temp = vno1->op[0];
- vno1->op[0] = vno1->op[1];
- vno1->op[1] = temp;
- }
+ std::swap (vno1->op[0], vno1->op[1]);
hstate.add_int (vno1->opcode);
for (i = 0; i < vno1->length; ++i)
for (j = 0; j < group_size; ++j)
if (!matches[j])
{
- gimple tem = oprnds_info[0]->def_stmts[j];
- oprnds_info[0]->def_stmts[j] = oprnds_info[1]->def_stmts[j];
- oprnds_info[1]->def_stmts[j] = tem;
+ std::swap (oprnds_info[0]->def_stmts[j],
+ oprnds_info[1]->def_stmts[j]);
dump_printf (MSG_NOTE, "%d ", j);
}
dump_printf (MSG_NOTE, "\n");
}
if (BYTES_BIG_ENDIAN && c1 != VEC_WIDEN_MULT_EVEN_EXPR)
- {
- enum tree_code ctmp = c1;
- c1 = c2;
- c2 = ctmp;
- }
+ std::swap (c1, c2);
if (code == FIX_TRUNC_EXPR)
{
prod3. */
/* min0min1 > max0max1 */
if (wi::gts_p (prod0, prod3))
- {
- vrp_int tmp = prod3;
- prod3 = prod0;
- prod0 = tmp;
- }
+ std::swap (prod0, prod3);
/* min0max1 > max0min1 */
if (wi::gts_p (prod1, prod2))
- {
- vrp_int tmp = prod2;
- prod2 = prod1;
- prod1 = tmp;
- }
+ std::swap (prod1, prod2);
if (wi::gts_p (prod0, prod1))
- {
- vrp_int tmp = prod1;
- prod1 = prod0;
- prod0 = tmp;
- }
+ std::swap (prod0, prod1);
if (wi::gts_p (prod2, prod3))
- {
- vrp_int tmp = prod3;
- prod3 = prod2;
- prod2 = tmp;
- }
+ std::swap (prod2, prod3);
/* diff = max - min. */
prod2 = prod3 - prod0;
{
/* If the range was reversed, swap MIN and MAX. */
if (cmp == 1)
- {
- tree t = min;
- min = max;
- max = t;
- }
+ std::swap (min, max);
}
cmp = compare_values (min, max);