* sh.c (gen_ashift_hi): Don't make SUBREG of a SUBREG.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 1998 12:25:51 +0000 (12:25 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 1998 12:25:51 +0000 (12:25 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19432 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sh/sh.c

index 0390e7a..601d8fa 100644 (file)
@@ -1,3 +1,7 @@
+Mon Apr 27 20:22:08 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * sh.c (gen_ashift_hi): Don't make SUBREG of a SUBREG.
+
 Mon Apr 27 18:23:51 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
         * sh.c (sh_expand_prologue, sh_expand_epilogue):
index 03f6b8a..7e4fa2c 100644 (file)
@@ -922,8 +922,16 @@ gen_ashift_hi (type, n, reg)
         zero/sign extension.
         gen_ashift_hi is only called in contexts where we know that the
         sign extension works out correctly.  */
-      gen_ashift (type, n, gen_rtx_SUBREG (SImode, reg, 0));
-      break;
+      {
+       int word = 0;
+       if (GET_CODE (reg) == SUBREG)
+         {
+           word = SUBREG_WORD (reg);
+           reg = SUBREG_REG (reg);
+         }
+       gen_ashift (type, n, gen_rtx_SUBREG (SImode, reg, word));
+       break;
+      }
     case ASHIFT:
       emit_insn (gen_ashlhi3_k (reg, reg, GEN_INT (n)));
       break;