aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2015-06-12 13:18:17 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2015-06-12 13:18:17 +0000
commitd8204b12f67e69835e793d6700b09bf7e1a474a8 (patch)
tree1b1da174b1651e19470693536e4c4f14643d99df /gcc
parent7388ee9e9b9e899ec7939e84716af40c43d7d6d4 (diff)
downloadgcc-d8204b12f67e69835e793d6700b09bf7e1a474a8.zip
gcc-d8204b12f67e69835e793d6700b09bf7e1a474a8.tar.gz
gcc-d8204b12f67e69835e793d6700b09bf7e1a474a8.tar.bz2
[ifcvt][obvious] Use std::swap instead of manually swapping
* ifcvt.c (noce_try_store_flag_constants): Use std::swap instead of manually swapping. (noce_try_cmove_arith): Likewise. (noce_get_alt_condition): Likewise. From-SVN: r224429
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/ifcvt.c12
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74df9aa..efa166a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * ifcvt.c (noce_try_store_flag_constants): Use std::swap instead of
+ manually swapping.
+ (noce_try_cmove_arith): Likewise.
+ (noce_get_alt_condition): Likewise.
+
2015-06-12 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
* common/config/i386/i386-common.c
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index fd3d258..50ccaa1 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1217,7 +1217,7 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
if (reversep)
{
- tmp = itrue; itrue = ifalse; ifalse = tmp;
+ std::swap (itrue, ifalse);
diff = trunc_int_for_mode (-(unsigned HOST_WIDE_INT) diff, mode);
}
@@ -1679,11 +1679,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (reversep)
{
- rtx tmp;
- rtx_insn *tmp_insn;
code = reversed_comparison_code (if_info->cond, if_info->jump);
- tmp = a, a = b, b = tmp;
- tmp_insn = insn_a, insn_a = insn_b, insn_b = tmp_insn;
+ std::swap (a, b);
+ std::swap (insn_a, insn_b);
}
}
@@ -1865,9 +1863,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
if (CONST_INT_P (op_a))
{
- rtx tmp = op_a;
- op_a = op_b;
- op_b = tmp;
+ std::swap (op_a, op_b);
code = swap_condition (code);
}
}