aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-12-20 19:16:01 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-12-20 19:16:01 -0500
commit674d5d8bef3bbec5b9f2d75aa22402b48ceb1b28 (patch)
treeba82c1a724cae651ccea001ddc0954e44639238a /gcc
parent405c5495313248c057a9d6df722134f49672a086 (diff)
downloadgcc-674d5d8bef3bbec5b9f2d75aa22402b48ceb1b28.zip
gcc-674d5d8bef3bbec5b9f2d75aa22402b48ceb1b28.tar.gz
gcc-674d5d8bef3bbec5b9f2d75aa22402b48ceb1b28.tar.bz2
(gen_lowpart_common): Return a new hard reg even if not valid in MODE
if the input REG is not valid in its mode. From-SVN: r6249
Diffstat (limited to 'gcc')
-rw-r--r--gcc/emit-rtl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 3fba616..1270521 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -595,9 +595,14 @@ gen_lowpart_common (mode, x)
else if (GET_CODE (x) == REG)
{
/* If the register is not valid for MODE, return 0. If we don't
- do this, there is no way to fix up the resulting REG later. */
+ do this, there is no way to fix up the resulting REG later.
+ But we do do this if the current REG is not valid for its
+ mode. This latter is a kludge, but is required due to the
+ way that parameters are passed on some machines, most
+ notably Sparc. */
if (REGNO (x) < FIRST_PSEUDO_REGISTER
- && ! HARD_REGNO_MODE_OK (REGNO (x) + word, mode))
+ && ! HARD_REGNO_MODE_OK (REGNO (x) + word, mode)
+ && HARD_REGNO_MODE_OK (REGNO (x), GET_MODE (x)))
return 0;
else if (REGNO (x) < FIRST_PSEUDO_REGISTER
/* integrate.c can't handle parts of a return value register. */