public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9338] i386: Eliminate common code from x86_32 TARGET_MACHO part in ix86_expand_move
Date: Wed,  6 Mar 2024 16:09:20 +0000 (GMT)	[thread overview]
Message-ID: <20240306160920.4C8603858D34@sourceware.org> (raw)

https://gcc.gnu.org/g:e772c0c05c36d0b0539effb4256be67bbedd77fb

commit r14-9338-ge772c0c05c36d0b0539effb4256be67bbedd77fb
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Mar 6 17:08:25 2024 +0100

    i386: Eliminate common code from x86_32 TARGET_MACHO part in ix86_expand_move
    
    Eliminate common code from x86_32 TARGET_MACHO part in ix86_expand_move and
    use generic code instead.
    
    No functional changes.
    
    gcc/ChangeLog:
    
            * config/i386/i386-expand.cc (ix86_expand_move) [TARGET_MACHO]:
            Eliminate common code and use generic code instead.

Diff:
---
 gcc/config/i386/i386-expand.cc | 37 +++++++++++--------------------------
 1 file changed, 11 insertions(+), 26 deletions(-)

diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 3b1685ae448..2210e6f7cc8 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -471,9 +471,9 @@ ix86_expand_move (machine_mode mode, rtx operands[])
   if ((flag_pic || MACHOPIC_INDIRECT)
       && symbolic_operand (op1, mode))
     {
+#if TARGET_MACHO
       if (TARGET_MACHO && !TARGET_64BIT)
 	{
-#if TARGET_MACHO
 	  /* dynamic-no-pic */
 	  if (MACHOPIC_INDIRECT)
 	    {
@@ -490,33 +490,18 @@ ix86_expand_move (machine_mode mode, rtx operands[])
 	      emit_insn (insn);
 	      return;
 	    }
-	  if (GET_CODE (op0) == MEM)
-	    op1 = force_reg (Pmode, op1);
-	  else
-	    {
-	      rtx temp = op0;
-	      if (GET_CODE (temp) != REG)
-		temp = gen_reg_rtx (Pmode);
-	      temp = legitimize_pic_address (op1, temp);
-	      if (temp == op0)
-	    return;
-	      op1 = temp;
-	    }
-      /* dynamic-no-pic */
-#endif
 	}
-      else
+#endif
+
+      if (MEM_P (op0))
+	op1 = force_reg (mode, op1);
+      else if (!(TARGET_64BIT && x86_64_movabs_operand (op1, DImode)))
 	{
-	  if (MEM_P (op0))
-	    op1 = force_reg (mode, op1);
-	  else if (!(TARGET_64BIT && x86_64_movabs_operand (op1, DImode)))
-	    {
-	      rtx reg = can_create_pseudo_p () ? NULL_RTX : op0;
-	      op1 = legitimize_pic_address (op1, reg);
-	      if (op0 == op1)
-		return;
-	      op1 = convert_to_mode (mode, op1, 1);
-	    }
+	  rtx reg = can_create_pseudo_p () ? NULL_RTX : op0;
+	  op1 = legitimize_pic_address (op1, reg);
+	  if (op0 == op1)
+	    return;
+	  op1 = convert_to_mode (mode, op1, 1);
 	}
     }
   else

                 reply	other threads:[~2024-03-06 16: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=20240306160920.4C8603858D34@sourceware.org \
    --to=uros@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).