(movqi, movhi, movsi): Make sure that address returned from
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 15 May 1993 17:23:58 +0000 (13:23 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 15 May 1993 17:23:58 +0000 (13:23 -0400)
force_const_mem is valid.

From-SVN: r4475

gcc/config/rs6000/rs6000.md

index 91bcbab9ff6a86d03a2bdf6b954e010efb188fb1..a9272ba715c645f531a79ef6273a29bc7279f788 100644 (file)
     operands[1] = force_reg (SImode, operands[1]);
 
   if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT)
-    operands[1] = force_const_mem (SImode, operands[1]);
+    {
+      operands[1] = force_const_mem (SImode, operands[1]);
+      if (! memory_address_p (SImode, XEXP (operands[1], 0))
+         && ! reload_in_progress)
+       operands[1] = change_address (operands[1], SImode,
+                                     XEXP (operands[1], 0));
+    }
 
   if (GET_CODE (operands[1]) == CONST_INT
       && (unsigned) (INTVAL (operands[1]) + 0x8000) >= 0x10000
     operands[1] = force_reg (HImode, operands[1]);
 
   if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT)
-    operands[1] = force_const_mem (HImode, operands[1]);
+    {
+      operands[1] = force_const_mem (HImode, operands[1]);
+      if (! memory_address_p (HImode, XEXP (operands[1], 0))
+         && ! reload_in_progress)
+       operands[1] = change_address (operands[1], HImode,
+                                     XEXP (operands[1], 0));
+    }
 }")
 
 (define_insn ""
     operands[1] = force_reg (QImode, operands[1]);
 
   if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT)
-    operands[1] = force_const_mem (QImode, operands[1]);
+    {
+      operands[1] = force_const_mem (QImode, operands[1]);
+      if (! memory_address_p (QImode, XEXP (operands[1], 0))
+         && ! reload_in_progress)
+       operands[1] = change_address (operands[1], QImode,
+                                     XEXP (operands[1], 0));
+    }
 }")
 
 (define_insn ""