public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Richard Henderson <rth@redhat.com>
Subject: [PATCH, alpha]: Use std::swap
Date: Tue, 11 Nov 2014 17:37:00 -0000	[thread overview]
Message-ID: <CAFULd4YHt-90Zj6Uo9WaY0Z_yiv-MOWV+Bth4f-fTtKfwoBsRg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hello!

2014-11-11  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.c (alpha_emit_conditional_branch): Replace
    open-coded swap with std::swap to swap values.
    (alpha_emit_setcc): Ditto.
    (alpha_emit_conditional_move): Ditto.
    (alpha_split_tmode_pair): Ditto.

Bootstrapped and regression tested on alphaev68-linux-gnu, committed
to mainline SVN.

Uros.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 1889 bytes --]

Index: alpha.c
===================================================================
--- alpha.c	(revision 217320)
+++ alpha.c	(working copy)
@@ -2545,7 +2545,7 @@ alpha_emit_conditional_branch (rtx operands[], mac
 	{
 	  cmp_code = swap_condition (code);
 	  branch_code = NE;
-	  tem = op0, op0 = op1, op1 = tem;
+	  std::swap (op0, op1);
 	}
       else
 	{
@@ -2569,7 +2569,7 @@ alpha_emit_conditional_branch (rtx operands[], mac
 	  else if (op0 == CONST0_RTX (DFmode))
 	    {
 	      /* Undo the swap we probably did just above.  */
-	      tem = op0, op0 = op1, op1 = tem;
+	      std::swap (op0, op1);
 	      branch_code = swap_condition (cmp_code);
 	      cmp_code = UNKNOWN;
 	    }
@@ -2689,7 +2689,7 @@ alpha_emit_setcc (rtx operands[], machine_mode cmp
       code = swap_condition (code);
       if (cmp_mode == DFmode)
 	cmp_code = code, code = NE;
-      tmp = op0, op0 = op1, op1 = tmp;
+      std::swap (op0, op1);
       break;
 
     default:
@@ -2786,7 +2786,7 @@ alpha_emit_conditional_move (rtx cmp, machine_mode
 	    {
 	      cmp_code = swap_condition (code);
 	      code = NE;
-	      tem = op0, op0 = op1, op1 = tem;
+	      std::swap (op0, op1);
 	    }
 	  break;
 
@@ -2857,7 +2857,7 @@ alpha_emit_conditional_move (rtx cmp, machine_mode
       if (cmp_mode == DImode && op1 == const0_rtx)
 	break;
       code = swap_condition (code);
-      tem = op0, op0 = op1, op1 = tem;
+      std::swap (op0, op1);
       break;
 
     default:
@@ -3318,9 +3318,8 @@ alpha_split_tmode_pair (rtx operands[4], machine_m
 
   if (fixup_overlap && reg_overlap_mentioned_p (operands[0], operands[3]))
     {
-      rtx tmp;
-      tmp = operands[0], operands[0] = operands[1], operands[1] = tmp;
-      tmp = operands[2], operands[2] = operands[3], operands[3] = tmp;
+      std::swap (operands[0], operands[1]);
+      std::swap (operands[2], operands[3]);
     }
 }
 

                 reply	other threads:[~2014-11-11 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFULd4YHt-90Zj6Uo9WaY0Z_yiv-MOWV+Bth4f-fTtKfwoBsRg@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).