summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-12-21 00:16:01 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-12-21 00:16:01 +0000
commitc84a933ed3bd3ac4bd358852b0aa26d1ef192cb4 (patch)
treeba82c1a724cae651ccea001ddc0954e44639238a /gcc/emit-rtl.c
parent43e3c91f2006d648341cb8d5a5718346f0052222 (diff)
downloadgcc-c84a933ed3bd3ac4bd358852b0aa26d1ef192cb4.tar.gz
(gen_lowpart_common): Return a new hard reg even if not valid in MODE
if the input REG is not valid in its mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6249 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-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 3fba61625b1..127052178aa 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. */