]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
m68k: replace reload_in_progress by reload_in_progress || lra_in_progress
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 11 Oct 2024 08:28:38 +0000 (10:28 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Sun, 13 Oct 2024 14:56:36 +0000 (16:56 +0200)
For now assume that LRA needs the same treatment as reload.

* config/m68k/m68k.md ("movsi", "movxf"): Replace
reload_in_progress by reload_in_progress || lra_in_progress.
* config/m68k/m68k.cc (m68k_legitimate_mem_p)
(emit_move_sequence): Likewise.
* config/m68k/predicates.md ("fp_src_operand"): Likewise.

gcc/config/m68k/m68k.cc
gcc/config/m68k/m68k.md
gcc/config/m68k/predicates.md

index 7986e92c5116a30e4fbef8b0c46c81d3d4e73ef2..729a1e8875d9681b43edd77d8c9005687c5461c3 100644 (file)
@@ -2352,7 +2352,8 @@ m68k_legitimate_mem_p (rtx x, struct m68k_address *address)
 {
   return (MEM_P (x)
          && m68k_decompose_address (GET_MODE (x), XEXP (x, 0),
-                                    reload_in_progress || reload_completed,
+                                    (reload_in_progress || lra_in_progress
+                                     || reload_completed),
                                     address));
 }
 
@@ -3899,11 +3900,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
   rtx tem;
 
   if (scratch_reg
-      && reload_in_progress && GET_CODE (operand0) == REG
+      && (reload_in_progress || lra_in_progress)
+      && GET_CODE (operand0) == REG
       && REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
     operand0 = reg_equiv_mem (REGNO (operand0));
   else if (scratch_reg
-          && reload_in_progress && GET_CODE (operand0) == SUBREG
+          && (reload_in_progress || lra_in_progress)
+          && GET_CODE (operand0) == SUBREG
           && GET_CODE (SUBREG_REG (operand0)) == REG
           && REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER)
     {
@@ -3916,11 +3919,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
     }
 
   if (scratch_reg
-      && reload_in_progress && GET_CODE (operand1) == REG
+      && (reload_in_progress || lra_in_progress)
+      && GET_CODE (operand1) == REG
       && REGNO (operand1) >= FIRST_PSEUDO_REGISTER)
     operand1 = reg_equiv_mem (REGNO (operand1));
   else if (scratch_reg
-          && reload_in_progress && GET_CODE (operand1) == SUBREG
+          && (reload_in_progress || lra_in_progress)
+          && GET_CODE (operand1) == SUBREG
           && GET_CODE (SUBREG_REG (operand1)) == REG
           && REGNO (SUBREG_REG (operand1)) >= FIRST_PSEUDO_REGISTER)
     {
@@ -3932,11 +3937,13 @@ emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
       operand1 = alter_subreg (&temp, true);
     }
 
-  if (scratch_reg && reload_in_progress && GET_CODE (operand0) == MEM
+  if (scratch_reg && (reload_in_progress || lra_in_progress)
+      && GET_CODE (operand0) == MEM
       && ((tem = find_replacement (&XEXP (operand0, 0)))
          != XEXP (operand0, 0)))
     operand0 = gen_rtx_MEM (GET_MODE (operand0), tem);
-  if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM
+  if (scratch_reg && (reload_in_progress || lra_in_progress)
+      && GET_CODE (operand1) == MEM
       && ((tem = find_replacement (&XEXP (operand1, 0)))
          != XEXP (operand1, 0)))
     operand1 = gen_rtx_MEM (GET_MODE (operand1), tem);
index e5c2528884488cc79875f31d1617f1c4df0e9ffa..1c9a6bf1748cacc72bc9d6c648e3fb62ef72d224 100644 (file)
       /* The source is an address which requires PIC relocation.
          Call legitimize_pic_address with the source, mode, and a relocation
          register (a new pseudo, or the final destination if reload_in_progress
-         is set).   Then fall through normally */
-      rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
+         or lra_in_progress is set).   Then fall through normally */
+      rtx temp = ((reload_in_progress || lra_in_progress)
+                 ? operands[0] : gen_reg_rtx (Pmode));
       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
     }
-  else if (flag_pic && TARGET_PCREL && ! reload_in_progress)
+  else if (flag_pic && TARGET_PCREL && ! (reload_in_progress || lra_in_progress))
     {
       /* Don't allow writes to memory except via a register;
         the m68k doesn't consider PC-relative addresses to be writable.  */
   ""
 {
   /* We can't rewrite operands during reload.  */
-  if (! reload_in_progress)
+  if (! (reload_in_progress || lra_in_progress))
     {
       if (CONSTANT_P (operands[1]))
        {
index 46fc3795a178943f83eab0979db3a4c66a984d91..787e544a43f53c54bb5b29d4661a755943b1dda8 100644 (file)
          || (TARGET_68881
              && (!standard_68881_constant_p (op)
                  || reload_in_progress
+                 || lra_in_progress
                  || reload_completed)));
 })