This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use std::swap in expand_mult


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]