diff options
author | Joern Rennecke <amylaar@cygnus.co.uk> | 1998-04-02 02:42:26 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-04-01 18:42:26 -0800 |
commit | a9a2595b5892b183a7435432b7835b2f416315ac (patch) | |
tree | f59e40f4deba74dfcf190f270a49743212d8ea4f /gcc/reload.c | |
parent | ce4d78eb2f91ec1b5278a4a23467055089ccc22f (diff) | |
download | gcc-a9a2595b5892b183a7435432b7835b2f416315ac.zip gcc-a9a2595b5892b183a7435432b7835b2f416315ac.tar.gz gcc-a9a2595b5892b183a7435432b7835b2f416315ac.tar.bz2 |
reload.c (find_reloads_address): Try LEGITIMIZE_RELOAD_ADDRESS.
* reload.c (find_reloads_address): Try LEGITIMIZE_RELOAD_ADDRESS.
(move_replacements): New function.
* reload.h: Prototype it.
* alpha.h (LEGITIMIZE_RELOAD_ADDRESS): New definition.
Co-Authored-By: Richard Henderson <rth@cygnus.com>
From-SVN: r18947
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index e89c251..6548243 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. */ |