+Thu Sep 24 18:48:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * 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.
+
Thu Sep 24 17:45:55 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* expr.c (store_constructor): When initializing a field that is smaller
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];
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;
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;
+ }
+ }
+ }
}
}
}