If operand1 is an invalid PIC address, then legitimize it before doing anything else.
authorStan Cox <coxs@gnu.org>
Thu, 6 Oct 1994 15:13:26 +0000 (15:13 +0000)
committerStan Cox <coxs@gnu.org>
Thu, 6 Oct 1994 15:13:26 +0000 (15:13 +0000)
From-SVN: r8228

gcc/config/m88k/m88k.c

index 28ac763..b8ec1bd 100644 (file)
@@ -224,6 +224,10 @@ emit_move_sequence (operands, mode, scratch)
   register rtx operand0 = operands[0];
   register rtx operand1 = operands[1];
 
+  if (CONSTANT_P (operand1) && flag_pic
+      && pic_address_needs_scratch (operand1))
+    operands[1] = operand1 = legitimize_address (1, operand1, 0, 0);
+
   /* Handle most common case first: storing into a register.  */
   if (register_operand (operand0, mode))
     {