This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][i386][obvious] Use std::swap instead of manually swapping in a couple of places
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 19 Jun 2015 11:50:57 +0100
- Subject: [PATCH][i386][obvious] Use std::swap instead of manually swapping in a couple of places
- Authentication-results: sourceware.org; auth=none
Hi all,
Bootstrapped and tested on x86_64-linx.
Will commit shortly as obvious.
Thanks,
Kyrill
2015-06-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/i386/i386.c (ix86_function_versions): Use std::swap instead
of manually swapping.
(expand_vec_perm_interleave2): Likewise.
commit c4e17657d5557ec58e910b9cdecdda85f9bb196a
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Fri Jun 19 10:45:52 2015 +0100
[i386] Use std::swap instead of manually swapping in a couple of places
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 622c5f5..4cb8fe8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -34903,9 +34903,7 @@ ix86_function_versions (tree fn1, tree fn2)
{
if (attr2 != NULL_TREE)
{
- tree tem = fn1;
- fn1 = fn2;
- fn2 = tem;
+ std::swap (fn1, fn2);
attr1 = attr2;
}
error_at (DECL_SOURCE_LOCATION (fn2),
@@ -47911,9 +47909,7 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d)
{
/* Attempt to increase the likelihood that dfinal
shuffle will be intra-lane. */
- char tmph = nonzero_halves[0];
- nonzero_halves[0] = nonzero_halves[1];
- nonzero_halves[1] = tmph;
+ std::swap (nonzero_halves[0], nonzero_halves[1]);
}
/* vperm2f128 or vperm2i128. */