]> gcc.gnu.org Git - gcc.git/commitdiff
i386: Eliminate common code from x86_32 TARGET_MACHO part in ix86_expand_move
authorUros Bizjak <ubizjak@gmail.com>
Wed, 6 Mar 2024 16:08:25 +0000 (17:08 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 6 Mar 2024 16:08:25 +0000 (17:08 +0100)
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.

gcc/config/i386/i386-expand.cc

index 3b1685ae44828aaf9f07adaa37d550111230b340..2210e6f7cc8563047e5714dc8e46166a557be91e 100644 (file)
@@ -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
This page took 0.072082 seconds and 5 git commands to generate.