aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-09-14 16:20:28 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-09-14 16:20:28 -0400
commitea8262b0a5b761d391a8866fd1837067f3e0a8ef (patch)
tree03c55f9b8adead292f668b709145ccc617282630 /gcc
parent4a368461a5ad25568743718bd8c3b8355bd278de (diff)
downloadgcc-ea8262b0a5b761d391a8866fd1837067f3e0a8ef.zip
gcc-ea8262b0a5b761d391a8866fd1837067f3e0a8ef.tar.gz
gcc-ea8262b0a5b761d391a8866fd1837067f3e0a8ef.tar.bz2
(gen_lowpart): If gen_lowpart_common fails for a REG, load it into a
pseudo and try again. From-SVN: r10349
Diffstat (limited to 'gcc')
-rw-r--r--gcc/emit-rtl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 1404770..9600f2f 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -857,6 +857,13 @@ gen_lowpart (mode, x)
if (result)
return result;
+ else if (GET_CODE (x) == REG)
+ {
+ /* Must be a hard reg that's not valid in MODE. */
+ result = gen_lowpart_common (mode, copy_to_reg (x));
+ if (result == 0)
+ abort ();
+ }
else if (GET_CODE (x) == MEM)
{
/* The only additional case we can do is MEM. */