aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGreg McGary <gkm@gnu.org>1998-04-17 16:35:07 +0000
committerRichard Henderson <rth@gcc.gnu.org>1998-04-17 09:35:07 -0700
commit6cca74ab23bd2c431e11461ae42dada84dc667bc (patch)
treecc6c41ce1ae9c962e9c0a5be1f3ed22e9ea29a10 /gcc
parent4daa9c14297ebb5fb84a1f47510ef102f805593c (diff)
downloadgcc-6cca74ab23bd2c431e11461ae42dada84dc667bc.zip
gcc-6cca74ab23bd2c431e11461ae42dada84dc667bc.tar.gz
gcc-6cca74ab23bd2c431e11461ae42dada84dc667bc.tar.bz2
* emit-rtl.c (gen_highpart): initialize `word' properly for pseudo.
From-SVN: r19271
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/emit-rtl.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9790268..23a0e8f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Fri Apr 17 16:35:35 1998 Greg McGary <gkm@gnu.org>
+
+ * emit-rtl.c (gen_highpart): initialize `word' properly for pseudo.
+
Fri Apr 17 14:30:37 1998 John Carr <jfc@mit.edu>
* emit-rtl.c (operand_subword_force): If a register can not be
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 40b0aa5..aafc41c 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. */