summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-17 16:35:07 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-17 16:35:07 +0000
commit6ec4ccb1d1a4767eafd1fe77a79ffa540f28f23f (patch)
treecc6c41ce1ae9c962e9c0a5be1f3ed22e9ea29a10 /gcc/emit-rtl.c
parent683c151c681305fc13504b8abd3811090e525dab (diff)
downloadgcc-6ec4ccb1d1a4767eafd1fe77a79ffa540f28f23f.tar.gz
* emit-rtl.c (gen_highpart): initialize `word' properly for pseudo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 40b0aa54e51..aafc41c28eb 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1011,18 +1011,24 @@ gen_highpart (mode, x)
}
else if (GET_CODE (x) == REG)
{
- int word = 0;
+ int word;
/* Let the backend decide how many registers to skip. This is needed
in particular for sparc64 where fp regs are smaller than a word. */
/* ??? Note that subregs are now ambiguous, in that those against
- pseudos are sized by the Word Size, while those against hard
+ pseudos are sized by the word size, while those against hard
regs are sized by the underlying register size. Better would be
to always interpret the subreg offset parameter as bytes or bits. */
- if (! WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER)
+ if (WORDS_BIG_ENDIAN)
+ word = 0;
+ else if (REGNO (x) < FIRST_PSEUDO_REGISTER)
word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
- HARD_REGNO_NREGS (REGNO (x), mode));
+ else
+ word = ((GET_MODE_SIZE (GET_MODE (x))
+ - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD))
+ / UNITS_PER_WORD);
if (REGNO (x) < FIRST_PSEUDO_REGISTER
/* integrate.c can't handle parts of a return value register. */