From 674d5d8bef3bbec5b9f2d75aa22402b48ceb1b28 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 20 Dec 1993 19:16:01 -0500 Subject: (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 --- gcc/emit-rtl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/emit-rtl.c') 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. */ -- cgit v1.1