This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Use std::swap in expand_mult
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Dec 2014 18:11:55 +0100
- Subject: [PATCH] Use std::swap in expand_mult
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
While looking at PR59708, I've noticed this. Ok for trunk?
2014-12-03 Jakub Jelinek <jakub@redhat.com>
* expmed.c (expand_mult): Use std::swap.
--- gcc/expmed.c.jj 2014-11-18 08:26:45.000000000 +0100
+++ gcc/expmed.c 2014-12-03 11:12:37.519297971 +0100
@@ -3087,11 +3087,7 @@ expand_mult (machine_mode mode, rtx op0,
bool do_trapv = flag_trapv && SCALAR_INT_MODE_P (mode) && !unsignedp;
if (CONSTANT_P (op0))
- {
- rtx temp = op0;
- op0 = op1;
- op1 = temp;
- }
+ std::swap (op0, op1);
/* For vectors, there are several simplifications that can be made if
all elements of the vector constant are identical. */
Jakub