aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-01-20 17:23:12 -0800
committerJim Wilson <wilson@gcc.gnu.org>1995-01-20 17:23:12 -0800
commit23ed92ca4c901a654040989a067819c1f0b77860 (patch)
tree2613a5839e5c1496cf0d71de96d6bdd1c905a3e0 /gcc
parenta7771f7854f45f306657fd0d72833ee6a78c4afc (diff)
downloadgcc-23ed92ca4c901a654040989a067819c1f0b77860.zip
gcc-23ed92ca4c901a654040989a067819c1f0b77860.tar.gz
gcc-23ed92ca4c901a654040989a067819c1f0b77860.tar.bz2
(machine_dependent_reorg): When remove SUBREG, add in
SUBREG_WORD to new register number. From-SVN: r8778
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sh/sh.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index ce64a4e..fac1a76 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -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,