(machine_dependent_reorg): When remove SUBREG, add in
authorJim Wilson <wilson@gcc.gnu.org>
Sat, 21 Jan 1995 01:23:12 +0000 (17:23 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 21 Jan 1995 01:23:12 +0000 (17:23 -0800)
SUBREG_WORD to new register number.

From-SVN: r8778

gcc/config/sh/sh.c

index ce64a4e50a2400884391ae8ac9a743d1f712d4b1..fac1a76e593c6a7b752634e5a4b604a33c8f5d53 100644 (file)
@@ -1961,10 +1961,14 @@ machine_dependent_reorg (first)
                  if (mode == SImode && hi_const (src))
                    {
                      /* This is an HI source, clobber the dest to get the mode right too */
+                     int offset = 0;
                      mode = HImode;
                      while (GET_CODE (dst) == SUBREG)
-                       dst = SUBREG_REG (dst);
-                     dst = gen_rtx (REG, HImode, REGNO (dst));
+                       {
+                         offset += SUBREG_WORD (dst);
+                         dst = SUBREG_REG (dst);
+                       }
+                     dst = gen_rtx (REG, HImode, REGNO (dst) + offset);
                    }
                  lab = add_constant (src, mode);
                  newsrc = gen_rtx (MEM, mode,