(emit_move_sequence): If reload in progress, replace reference to
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 28 Oct 1996 22:22:21 +0000 (17:22 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 28 Oct 1996 22:22:21 +0000 (17:22 -0500)
pseudo with reference to corresponding MEM.

From-SVN: r13056

gcc/config/pa/pa.c

index 0cffa6007b60889560d4136de80545064f430363..74d7b8802a502018be960f7dc19dd0c45320059b 100644 (file)
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.  */
 #include "insn-attr.h"
 #include "flags.h"
 #include "tree.h"
+#include "reload.h"
 #include "c-tree.h"
 #include "expr.h"
 #include "obstack.h"
@@ -1059,6 +1060,22 @@ emit_move_sequence (operands, mode, scratch_reg)
   register rtx operand0 = operands[0];
   register rtx operand1 = operands[1];
 
+  if (reload_in_progress && GET_CODE (operand0) == REG
+      && REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
+    operand0 = reg_equiv_mem[REGNO (operand0)];
+  else if (reload_in_progress && GET_CODE (operand0) == SUBREG
+          && GET_CODE (SUBREG_REG (operand0)) == REG
+          && REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER)
+    SUBREG_REG (operand0) = reg_equiv_mem[REGNO (SUBREG_REG (operand0))];
+
+  if (reload_in_progress && GET_CODE (operand1) == REG
+      && REGNO (operand1) >= FIRST_PSEUDO_REGISTER)
+    operand1 = reg_equiv_mem[REGNO (operand1)];
+  else if (reload_in_progress && GET_CODE (operand1) == SUBREG
+          && GET_CODE (SUBREG_REG (operand1)) == REG
+          && REGNO (SUBREG_REG (operand1)) >= FIRST_PSEUDO_REGISTER)
+    SUBREG_REG (operand1) = reg_equiv_mem[REGNO (SUBREG_REG (operand1))];
+
   /* Handle secondary reloads for loads/stores of FP registers from
      REG+D addresses where D does not fit in 5 bits, including 
      (subreg (mem (addr))) cases.  */