(arith_reg_operand): Reject SUBREG of an invalid hard reg.
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 5 Aug 1996 21:27:22 +0000 (14:27 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 5 Aug 1996 21:27:22 +0000 (14:27 -0700)
From-SVN: r12594

gcc/config/sh/sh.c

index 6b8cc724a99ad8f0750c9855f05e33ae718c9ac3..834e60bf382a772e7f5e16533d2f0a0cb9152f91 100644 (file)
@@ -2198,13 +2198,17 @@ arith_reg_operand (op, mode)
 {
   if (register_operand (op, mode))
     {
+      int regno;
+
       if (GET_CODE (op) == REG)
-       return (REGNO (op) != T_REG
-               && REGNO (op) != PR_REG
-               && REGNO (op) != FPUL_REG
-               && REGNO (op) != MACH_REG
-               && REGNO (op) != MACL_REG);
-      return 1;
+       regno = REGNO (op);
+      else if (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)
+       regno = REGNO (SUBREG_REG (op));
+      else
+       return 1;
+
+      return (regno != T_REG && regno != PR_REG && regno != FPUL_REG
+             && regno != MACH_REG && regno != MACL_REG);
     }
   return 0;
 }