aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-08-19 16:04:22 +0000
committerJeff Law <law@gcc.gnu.org>1997-08-19 10:04:22 -0600
commita94ce33311d4bbc1f98d6f55beb133616347c682 (patch)
tree25b3a60e6623c4cd6da8ad483c50546a449f0d52 /gcc/reload.c
parente9576d2c229b3caea1c0c7fb0bd56eb1dd8537ee (diff)
downloadgcc-a94ce33311d4bbc1f98d6f55beb133616347c682.zip
gcc-a94ce33311d4bbc1f98d6f55beb133616347c682.tar.gz
gcc-a94ce33311d4bbc1f98d6f55beb133616347c682.tar.bz2
reload.c (find_reloads): Add code to convert RELOAD_FOR_OPADDR_ADDR reloads to...
* reload.c (find_reloads): Add code to convert RELOAD_FOR_OPADDR_ADDR reloads to RELOAD_FOR_OPERAND_ADDRESS reloads. * reload1.c: Undo bugfix from Aug 11. Back out "simple" patch for PA reload bug and install the one accepted by the FSF. From-SVN: r14847
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index a8bd5de..efd4aca 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3871,6 +3871,35 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
reload_opnum[i] = goal_alternative_matches[reload_opnum[i]];
}
+ /* Scan all the reloads, and check for RELOAD_FOR_OPERAND_ADDRESS reloads.
+ If we have more than one, then convert all RELOAD_FOR_OPADDR_ADDR
+ reloads to RELOAD_FOR_OPERAND_ADDRESS reloads.
+
+ choose_reload_regs assumes that RELOAD_FOR_OPADDR_ADDR reloads never
+ conflict with RELOAD_FOR_OPERAND_ADDRESS reloads. This is true for a
+ single pair of RELOAD_FOR_OPADDR_ADDR/RELOAD_FOR_OPERAND_ADDRESS reloads.
+ However, if there is more than one RELOAD_FOR_OPERAND_ADDRESS reload,
+ then a RELOAD_FOR_OPADDR_ADDR reload conflicts with all
+ RELOAD_FOR_OPERAND_ADDRESS reloads other than the one that uses it.
+ This is complicated by the fact that a single operand can have more
+ than one RELOAD_FOR_OPERAND_ADDRESS reload. It is very difficult to fix
+ choose_reload_regs without affecting code quality, and cases that
+ actually fail are extremely rare, so it turns out to be better to fix
+ the problem here by not generating cases that choose_reload_regs will
+ fail for. */
+
+ {
+ int op_addr_reloads = 0;
+ for (i = 0; i < n_reloads; i++)
+ if (reload_when_needed[i] == RELOAD_FOR_OPERAND_ADDRESS)
+ op_addr_reloads++;
+
+ if (op_addr_reloads > 1)
+ for (i = 0; i < n_reloads; i++)
+ if (reload_when_needed[i] == RELOAD_FOR_OPADDR_ADDR)
+ reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS;
+ }
+
/* See if we have any reloads that are now allowed to be merged
because we've changed when the reload is needed to
RELOAD_FOR_OPERAND_ADDRESS or RELOAD_FOR_OTHER_ADDRESS. Only