aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1998-09-24 10:51:35 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1998-09-24 11:51:35 +0100
commitc10638c92243bc58ec745d4229927a55ba8da730 (patch)
tree847a74a395f5537267706887c3082299e0c03adc /gcc/reload.c
parent34c73909813a5b2225ceac86dc6402f86b64d451 (diff)
downloadgcc-c10638c92243bc58ec745d4229927a55ba8da730.zip
gcc-c10638c92243bc58ec745d4229927a55ba8da730.tar.gz
gcc-c10638c92243bc58ec745d4229927a55ba8da730.tar.bz2
reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR reloads to RELOAD_FOR_X_ADDRESS...
* reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR reloads to RELOAD_FOR_X_ADDRESS reloads, test for reload sharing. Properly keep track of first RELOAD_FOR_X_ADDRESS also for more than 3 such reloads. If there is not more than one RELOAD_FOR_X_ADDRESS, don't change RELOAD_FOR_X_ADDR_ADDR reload. From-SVN: r22568
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 1aec4fb..428ce87 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4018,7 +4018,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
a single operand.
We can reduce the register pressure by exploiting that a
RELOAD_FOR_X_ADDR_ADDR that precedes all RELOAD_FOR_X_ADDRESS reloads
- does not conflict with any of them. */
+ does not conflict with any of them, if it is only used for the first of
+ the RELOAD_FOR_X_ADDRESS reloads. */
{
int first_op_addr_num = -2;
int first_inpaddr_num[MAX_RECOG_OPERANDS];
@@ -4037,21 +4038,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
switch (reload_when_needed[i])
{
case RELOAD_FOR_OPERAND_ADDRESS:
- if (! ++first_op_addr_num)
+ if (++first_op_addr_num >= 0)
{
- first_op_addr_num= i;
+ first_op_addr_num = i;
need_change = 1;
}
break;
case RELOAD_FOR_INPUT_ADDRESS:
- if (! ++first_inpaddr_num[reload_opnum[i]])
+ if (++first_inpaddr_num[reload_opnum[i]] >= 0)
{
first_inpaddr_num[reload_opnum[i]] = i;
need_change = 1;
}
break;
case RELOAD_FOR_OUTPUT_ADDRESS:
- if (! ++first_outpaddr_num[reload_opnum[i]])
+ if (++first_outpaddr_num[reload_opnum[i]] >= 0)
{
first_outpaddr_num[reload_opnum[i]] = i;
need_change = 1;
@@ -4085,8 +4086,24 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
default:
continue;
}
- if (i > first_num)
+ if (first_num < 0)
+ continue;
+ else if (i > first_num)
reload_when_needed[i] = type;
+ else
+ {
+ /* Check if the only TYPE reload that uses reload I is
+ reload FIRST_NUM. */
+ for (j = n_reloads - 1; j > first_num; j--)
+ {
+ if (reload_when_needed[j] == type
+ && reg_mentioned_p (reload_in[i], reload_in[j]))
+ {
+ reload_when_needed[i] = type;
+ break;
+ }
+ }
+ }
}
}
}