aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2000-07-27 01:45:41 +0000
committerJeff Law <law@gcc.gnu.org>2000-07-26 19:45:41 -0600
commitecbe6c619dae9c688d35d9080e2e76c11181e63b (patch)
treeb5fd8f2d6936fa8632e177ad7b97cd1f5be05964 /gcc
parentfc5f1cca41afa1c7635156a1eaa81d9050a5d0ab (diff)
downloadgcc-ecbe6c619dae9c688d35d9080e2e76c11181e63b.zip
gcc-ecbe6c619dae9c688d35d9080e2e76c11181e63b.tar.gz
gcc-ecbe6c619dae9c688d35d9080e2e76c11181e63b.tar.bz2
reload.c (find_reloads_toplev): Reload a paradoxical subreg of a mem if the address is a mode_dependent_address_p.
* reload.c (find_reloads_toplev): Reload a paradoxical subreg of a mem if the address is a mode_dependent_address_p. From-SVN: r35280
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/reload.c21
2 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61f1e38..2ee5949 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 26 19:44:05 2000 Hans-Peter Nilsson <hp@axis.com>
+
+ * reload.c (find_reloads_toplev): Reload a paradoxical subreg of a
+ mem if the address is a mode_dependent_address_p.
+
2000-07-26 Kazu Hirata <kazu@hxi.com>
* h8300.c (print_operand): Print ":8" when the 'R' operand is
diff --git a/gcc/reload.c b/gcc/reload.c
index f6621d8..d519708 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4335,6 +4335,25 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn,
x = find_reloads_subreg_address (x, 1, opnum, type, ind_levels,
insn);
}
+ else if (code == SUBREG && GET_CODE (SUBREG_REG (x)) == MEM
+ && (GET_MODE_SIZE (GET_MODE (x))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ && mode_dependent_address_p (XEXP (SUBREG_REG (x), 0)))
+ {
+ /* A paradoxical subreg will simply have the mode of the access
+ changed, so we need to reload such a memory operand to stabilize
+ the meaning of the memory access. */
+ enum machine_mode subreg_mode = GET_MODE (SUBREG_REG (x));
+
+ if (is_set_dest)
+ push_reload (NULL_RTX, SUBREG_REG (x), NULL_PTR, &SUBREG_REG (x),
+ find_valid_class (subreg_mode, SUBREG_WORD (x)),
+ VOIDmode, subreg_mode, 0, 0, opnum, type);
+ else
+ push_reload (SUBREG_REG (x), NULL_RTX, &SUBREG_REG (x), NULL_PTR,
+ find_valid_class (subreg_mode, SUBREG_WORD (x)),
+ subreg_mode, VOIDmode, 0, 0, opnum, type);
+ }
for (copied = 0, i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
@@ -5530,7 +5549,7 @@ find_reloads_subreg_address (x, force_replace, opnum, type,
/* Substitute into the current INSN the registers into which we have reloaded
the things that need reloading. The array `replacements'
- says contains the locations of all pointers that must be changed
+ contains the locations of all pointers that must be changed
and says what to replace them with.
Return the rtx that X translates into; usually X, but modified. */