aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-03-18 16:59:10 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-03-18 16:59:10 -0500
commit7a5b18b055a2e2bcf43fa8f75612ca1a21af9e1d (patch)
tree4573fd714cc603e199f8c3fb31866dae28793200 /gcc
parent94bafba74145e6735ecad4e0ee5651c70aea0201 (diff)
downloadgcc-7a5b18b055a2e2bcf43fa8f75612ca1a21af9e1d.zip
gcc-7a5b18b055a2e2bcf43fa8f75612ca1a21af9e1d.tar.gz
gcc-7a5b18b055a2e2bcf43fa8f75612ca1a21af9e1d.tar.bz2
(gen_reload): Handle paradoxical SUBREGs.
From-SVN: r9208
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reload1.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 7b9aa97..f8260c5 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1,5 +1,5 @@
/* Reload pseudo regs into hard regs for insns that require hard regs.
- Copyright (C) 1987, 88, 89, 92, 93, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92, 93, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -6649,6 +6649,20 @@ gen_reload (out, in, opnum, type)
enum reload_type type;
{
rtx last = get_last_insn ();
+ rtx tem;
+
+ /* If IN is a paradoxical SUBREG, remove it and try to put the
+ opposite SUBREG on OUT. Likewise for a paradoxical SUBREG on OUT. */
+ if (GET_CODE (in) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (in))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))))
+ && (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (in)), out)) != 0)
+ in = SUBREG_REG (in), out = tem;
+ else if (GET_CODE (out) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (out))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))
+ && (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (out)), in)) != 0)
+ out = SUBREG_REG (out), in = tem;
/* How to do this reload can get quite tricky. Normally, we are being
asked to reload a simple operand, such as a MEM, a constant, or a pseudo