reload patch applied
Joern Rennecke
amylaar@cygnus.co.uk
Tue Oct 26 19:22:00 GMT 1999
Reviewed By Jeffrey Law.
Wed Oct 27 03:09:23 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload.h (earlyclobber_operand_p): Declare.
* reload.c (earlyclobber_operand_p): Don't declare. No longer static.
* reload1.c (reload_reg_free_for_value_p): RELOAD_OTHER reloads with
an earlyclobbered output conflict with RELOAD_INPUT reloads - handle
case where the RELOAD_OTHER reload is new. Use earlyclobber_operand_p.
Index: reload.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload.h,v
retrieving revision 1.20
diff -p -r1.20 reload.h
*** reload.h 1999/10/17 08:19:37 1.20
--- reload.h 1999/10/27 02:12:57
*************** extern rtx find_equiv_reg PROTO((rtx, rt
*** 354,359 ****
--- 354,362 ----
/* Return 1 if register REGNO is the subject of a clobber in insn INSN. */
extern int regno_clobbered_p PROTO((int, rtx));
+ /* Return 1 if X is an operand of an insn that is being earlyclobbered. */
+ int earlyclobber_operand_p PROTO((rtx));
+
/* Functions in reload1.c: */
extern int reloads_conflict PROTO ((int, int));
Index: reload.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload.c,v
retrieving revision 1.86
diff -p -r1.86 reload.c
*** reload.c 1999/10/26 13:45:31 1.86
--- reload.c 1999/10/27 02:12:59
*************** static int find_reusable_reload PROTO((r
*** 252,258 ****
static rtx find_dummy_reload PROTO((rtx, rtx, rtx *, rtx *,
enum machine_mode, enum machine_mode,
enum reg_class, int, int));
- static int earlyclobber_operand_p PROTO((rtx));
static int hard_reg_set_here_p PROTO((int, int, rtx));
static struct decomposition decompose PROTO((rtx));
static int immune_p PROTO((rtx, rtx, struct decomposition));
--- 252,257 ----
*************** find_dummy_reload (real_in, real_out, in
*** 1921,1927 ****
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */
! static int
earlyclobber_operand_p (x)
rtx x;
{
--- 1920,1926 ----
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */
! int
earlyclobber_operand_p (x)
rtx x;
{
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.174
diff -p -r1.174 reload1.c
*** reload1.c 1999/10/26 13:45:31 1.174
--- reload1.c 1999/10/27 02:13:02
*************** reload_reg_free_for_value_p (regno, opnu
*** 5291,5296 ****
--- 5291,5300 ----
int ignore_address_reloads;
{
int time1;
+ /* Set if we see an input reload that must not share its reload register
+ with any new earlyclobber, but might otherwise share the reload
+ register with an output or input-output reload. */
+ int check_earlyclobber = 0;
int i;
int copy = 0;
*************** reload_reg_free_for_value_p (regno, opnu
*** 5372,5378 ****
if (! rld[i].in || ! rtx_equal_p (rld[i].in, value)
|| rld[i].out || out)
{
! int j, time2;
switch (rld[i].when_needed)
{
case RELOAD_FOR_OTHER_ADDRESS:
--- 5376,5382 ----
if (! rld[i].in || ! rtx_equal_p (rld[i].in, value)
|| rld[i].out || out)
{
! int time2;
switch (rld[i].when_needed)
{
case RELOAD_FOR_OTHER_ADDRESS:
*************** reload_reg_free_for_value_p (regno, opnu
*** 5411,5416 ****
--- 5415,5421 ----
break;
case RELOAD_FOR_INPUT:
time2 = rld[i].opnum * 4 + 4;
+ check_earlyclobber = 1;
break;
/* rld[i].opnum * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
== MAX_RECOG_OPERAND * 4 */
*************** reload_reg_free_for_value_p (regno, opnu
*** 5423,5428 ****
--- 5428,5434 ----
break;
case RELOAD_FOR_OPERAND_ADDRESS:
time2 = MAX_RECOG_OPERANDS * 4 + 2;
+ check_earlyclobber = 1;
break;
case RELOAD_FOR_INSN:
time2 = MAX_RECOG_OPERANDS * 4 + 3;
*************** reload_reg_free_for_value_p (regno, opnu
*** 5452,5460 ****
{
time2 = MAX_RECOG_OPERANDS * 4 + 4;
/* Earlyclobbered outputs must conflict with inputs. */
! for (j = 0; j < n_earlyclobbers; j++)
! if (rld[i].out == reload_earlyclobbers[j])
! time2 = MAX_RECOG_OPERANDS * 4 + 3;
break;
}
--- 5458,5465 ----
{
time2 = MAX_RECOG_OPERANDS * 4 + 4;
/* Earlyclobbered outputs must conflict with inputs. */
! if (earlyclobber_operand_p (rld[i].out))
! time2 = MAX_RECOG_OPERANDS * 4 + 3;
break;
}
*************** reload_reg_free_for_value_p (regno, opnu
*** 5478,5483 ****
--- 5483,5493 ----
}
}
}
+
+ /* Earlyclobbered outputs must conflict with inputs. */
+ if (check_earlyclobber && out && earlyclobber_operand_p (out))
+ return 0;
+
return 1;
}
More information about the Gcc-patches
mailing list