sh.md: Guard insn splits against illegal registers.
authorAndrew Haley <aph@cygnus.com>
Tue, 15 Feb 2000 23:25:28 +0000 (23:25 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Tue, 15 Feb 2000 23:25:28 +0000 (23:25 +0000)
* config/sh/sh.md: Guard insn splits against illegal registers.
* config/sh/sh.h: Correct comment about macros.

From-SVN: r31994

gcc/ChangeLog
gcc/config/sh/sh.h
gcc/config/sh/sh.md

index e315302d13604e49d71781312e6b971925143b87..263836457aef57ac8e5ce54a117ad751685b417d 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 15 23:22:26 2000  Andrew Haley  <aph@cygnus.com>
+
+       * config/sh/sh.md: Guard insn splits against illegal registers.
+       * config/sh/sh.h: Correct comment about macros.
+
 Tue Feb 15 22:30:36 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
                           Andrew MacLeod  <amacleod@cygnus.com>
 
index a3870df4832542eccaa9a953c75e7a1737f14e8c..df3b667e782e6c7b67bf6da6b63842356bbcd08d 100644 (file)
@@ -1269,9 +1269,7 @@ extern int current_function_anonymous_args;
 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
    that is a valid memory address for an instruction.
    The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.
-
-   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS.  */
+   that wants to use this address.  */
 
 #define MODE_DISP_OK_4(X,MODE) \
 (GET_MODE_SIZE (MODE) == 4 && (unsigned) INTVAL (X) < 64       \
index 237f774298d3e153237944f08bdc17acf2f37b7d..61720e07795cb25ad167ea5d4dc5fbf7ff91bce2 100644 (file)
     FAIL;
   reg = XEXP (addr, 0);
   const_int = XEXP (addr, 1);
-  if (GET_CODE (reg) != REG || GET_CODE (const_int) != CONST_INT)
+  if (! (BASE_REGISTER_RTX_P (reg) && INDEX_REGISTER_RTX_P (operands[2])
+        && GET_CODE (const_int) == CONST_INT))
     FAIL;
   emit_move_insn (operands[2], const_int);
   emit_move_insn (operands[0],
     FAIL;
   reg = XEXP (addr, 0);
   const_int = XEXP (addr, 1);
-  if (GET_CODE (reg) != REG || GET_CODE (const_int) != CONST_INT)
+  if (! (BASE_REGISTER_RTX_P (reg) && INDEX_REGISTER_RTX_P (operands[2])
+        && GET_CODE (const_int) == CONST_INT))
     FAIL;
   emit_move_insn (operands[2], const_int);
   emit_move_insn (change_address (operands[1], VOIDmode,