dojump.c (do_compare_rtx_and_jump): Use std::swap instead of manual swaps.
authorMikhail Maltsev <maltsevm@gmail.com>
Thu, 30 Apr 2015 03:47:40 +0000 (03:47 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 30 Apr 2015 03:47:40 +0000 (21:47 -0600)
2015-04-29  Mikhail Maltsev  <maltsevm@gmail.com>

        * dojump.c (do_compare_rtx_and_jump): Use std::swap instead of
        manual swaps.
        * expr.c (expand_expr_real_2): Likewise.

From-SVN: r222608

gcc/ChangeLog
gcc/dojump.c
gcc/expr.c

index bc06c7bb9d1a54686f179114b8942ac283bb9074..5c7558a82f3ace1b3c329fb732f12a84a8ad6408 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-29  Mikhail Maltsev  <maltsevm@gmail.com>
+
+       * dojump.c (do_compare_rtx_and_jump): Use std::swap instead of
+       manual swaps.
+       * expr.c (expand_expr_real_2): Likewise.
+
 2015-04-29  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree.c (build_common_builtin_nodes): Do not build
index ad356ba032ffed09fa30c6d0a0ea613af88a5c0c..0790c77d239537c20f0098ded011d9beef91b7b1 100644 (file)
@@ -987,9 +987,7 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
       if (can_compare_p (rcode, mode, ccp_jump)
          || (code == ORDERED && ! can_compare_p (ORDERED, mode, ccp_jump)))
        {
-          tem = if_true_label;
-          if_true_label = if_false_label;
-          if_false_label = tem;
+         std::swap (if_true_label, if_false_label);
          code = rcode;
          prob = inv (prob);
        }
@@ -1000,9 +998,7 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
 
   if (swap_commutative_operands_p (op0, op1))
     {
-      tem = op0;
-      op0 = op1;
-      op1 = tem;
+      std::swap (op0, op1);
       code = swap_condition (code);
     }
 
index 530a944da46152d07da226389ff78086937efcfa..25aa11f06e649ec78e883020b613e5eb86580684 100644 (file)
@@ -8870,11 +8870,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
 
       /* If op1 was placed in target, swap op0 and op1.  */
       if (target != op0 && target == op1)
-       {
-         temp = op0;
-         op0 = op1;
-         op1 = temp;
-       }
+       std::swap (op0, op1);
 
       /* We generate better code and avoid problems with op1 mentioning
         target by forcing op1 into a pseudo if it isn't a constant.  */