summaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-02 02:42:26 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-02 02:42:26 +0000
commitf64bc32a35bd0b111aa77ea7ee4a80362bd25704 (patch)
treef59e40f4deba74dfcf190f270a49743212d8ea4f /gcc/reload.c
parentf31c6cbf8af08b5e6ede02c4080f36aac962e162 (diff)
downloadgcc-f64bc32a35bd0b111aa77ea7ee4a80362bd25704.tar.gz
* reload.c (find_reloads_address): Try LEGITIMIZE_RELOAD_ADDRESS.
(move_replacements): New function. * reload.h: Prototype it. * alpha.h (LEGITIMIZE_RELOAD_ADDRESS): New definition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18947 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index e89c2515d9e..65482430234 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4422,6 +4422,24 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
return 0;
}
+#ifdef LEGITIMIZE_RELOAD_ADDRESS
+ do
+ {
+ if (memrefloc)
+ {
+ LEGITIMIZE_RELOAD_ADDRESS (ad, GET_MODE (*memrefloc), opnum, type,
+ ind_levels, win);
+ }
+ break;
+ win:
+ *memrefloc = copy_rtx (*memrefloc);
+ XEXP (*memrefloc, 0) = ad;
+ move_replacements (&ad, &XEXP (*memrefloc, 0));
+ return 1;
+ }
+ while (0);
+#endif
+
/* The address is not valid. We have to figure out why. One possibility
is that it is itself a MEM. This can happen when the frame pointer is
being eliminated, a pseudo is not allocated to a hard register, and the
@@ -5372,6 +5390,25 @@ copy_replacements (x, y)
}
}
}
+
+/* Change any replacements being done to *X to be done to *Y */
+
+void
+move_replacements (x, y)
+ rtx *x;
+ rtx *y;
+{
+ int i;
+
+ for (i = 0; i < n_replacements; i++)
+ if (replacements[i].subreg_loc == x)
+ replacements[i].subreg_loc = y;
+ else if (replacements[i].where == x)
+ {
+ replacements[i].where = y;
+ replacements[i].subreg_loc = 0;
+ }
+}
/* If LOC was scheduled to be replaced by something, return the replacement.
Otherwise, return *LOC. */