Fix v850 build problem stemming from Joern's reload patch.
authorJim Wilson <wilson@cygnus.com>
Thu, 22 Oct 1998 22:37:03 +0000 (22:37 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 22 Oct 1998 22:37:03 +0000 (15:37 -0700)
* v850/v850.c (v850_reorg): Call alter_subreg.  Delete subreg support.

From-SVN: r23234

gcc/ChangeLog
gcc/config/v850/v850.c

index 23b3802..cb9dd65 100644 (file)
@@ -1,3 +1,7 @@
+Thu Oct 22 22:34:42 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * v850/v850.c (v850_reorg): Call alter_subreg.  Delete subreg support.
+
 Fri Oct 23 11:11:56 1998  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * rtl.def (POST_MODIFY, PRE_MODIFY): New generalized operators for
index 8afb2f3..319b6ab 100644 (file)
@@ -1260,6 +1260,14 @@ void v850_reorg (start_insn)
              /* Memory operands are signed by default.  */
              int unsignedp = FALSE;
 
+             /* We might have (SUBREG (MEM)) here, so just get rid of the
+                subregs to make this code simpler.  It is safe to call
+                alter_subreg any time after reload.  */
+             if (GET_CODE (dest) == SUBREG)
+               dest = alter_subreg (dest);
+             if (GET_CODE (src) == SUBREG)
+               src = alter_subreg (src);
+
              if (GET_CODE (dest) == MEM && GET_CODE (src) == MEM)
                mem = NULL_RTX;
 
@@ -1312,20 +1320,13 @@ void v850_reorg (start_insn)
 
              /* Loading up a register in the basic block zaps any savings
                 for the register */
-             if (GET_CODE (dest) == REG || GET_CODE (dest) == SUBREG)
+             if (GET_CODE (dest) == REG)
                {
                  enum machine_mode mode = GET_MODE (dest);
-                 int word = 0;
                  int regno;
                  int endregno;
 
-                 while (GET_CODE (dest) == SUBREG)
-                   {
-                     word = SUBREG_WORD (dest);
-                     dest = SUBREG_REG (dest);
-                   }
-
-                 regno = REGNO (dest) + word;
+                 regno = REGNO (dest);
                  endregno = regno + HARD_REGNO_NREGS (regno, mode);
 
                  if (!use_ep)