alpha.c (alpha_split_conditional_move): Use std::swap instead of manually swapping.
authorUros Bizjak <ubizjak@gmail.com>
Thu, 12 Oct 2017 14:46:45 +0000 (16:46 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 12 Oct 2017 14:46:45 +0000 (16:46 +0200)
* config/alpha/alpha.c (alpha_split_conditional_move):
Use std::swap instead of manually swapping.
(alpha_stdarg_optimize_hook): Ditto.
(alpha_canonicalize_comparison): Ditto.

From-SVN: r253681

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 488a40d..ad116af 100644 (file)
@@ -1,3 +1,10 @@
+2017-10-12  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/alpha/alpha.c (alpha_split_conditional_move):
+       Use std::swap instead of manually swapping.
+       (alpha_stdarg_optimize_hook): Ditto.
+       (alpha_canonicalize_comparison): Ditto.
+
 2017-10-12  Bin Cheng  <bin.cheng@arm.com>
 
        * tree-loop-distribution.c (struct builtin_info): New struct.
index 41f3e3a..ece8879 100644 (file)
@@ -2910,8 +2910,8 @@ alpha_split_conditional_move (enum rtx_code code, rtx dest, rtx cond,
       || (code == GE || code == GT))
     {
       code = reverse_condition (code);
-      diff = t, t = f, f = diff;
-      diff = t - f;
+      std::swap (t, f);
+      diff = -diff;
     }
 
   subtarget = target = dest;
@@ -6078,10 +6078,8 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const gimple *stmt)
          else if (code2 == COMPONENT_REF
                   && (code1 == MINUS_EXPR || code1 == PLUS_EXPR))
            {
-             gimple *tem = arg1_stmt;
+             std::swap (arg1_stmt, arg2_stmt);
              code2 = code1;
-             arg1_stmt = arg2_stmt;
-             arg2_stmt = tem;
            }
          else
            goto escapes;
@@ -9831,9 +9829,7 @@ alpha_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
       && (*code == GE || *code == GT || *code == GEU || *code == GTU)
       && (REG_P (*op1) || *op1 == const0_rtx))
     {
-      rtx tem = *op0;
-      *op0 = *op1;
-      *op1 = tem;
+      std::swap (*op0, *op1);
       *code = (int)swap_condition ((enum rtx_code)*code);
     }