From 00c1cf38e148cdbd57d350e240684181dac01091 Mon Sep 17 00:00:00 2001 From: Mikhail Maltsev Date: Thu, 30 Apr 2015 03:47:40 +0000 Subject: [PATCH] dojump.c (do_compare_rtx_and_jump): Use std::swap instead of manual swaps. 2015-04-29 Mikhail Maltsev * 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 | 6 ++++++ gcc/dojump.c | 8 ++------ gcc/expr.c | 6 +----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc06c7bb9d1..5c7558a82f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-29 Mikhail Maltsev + + * 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 * tree.c (build_common_builtin_nodes): Do not build diff --git a/gcc/dojump.c b/gcc/dojump.c index ad356ba032f..0790c77d239 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -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); } diff --git a/gcc/expr.c b/gcc/expr.c index 530a944da46..25aa11f06e6 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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. */ -- 2.30.2