Commit 0f64b8f6 by Richard Kenner

(qty_changes_size): New variable.

(alloc_qty{,_for_scratch}, update_qty_class): Set it.
(local_alloc): Allocate it.
(find_free_reg): If CLASS_CANNOT_CHANGE_SIZE, avoid its registers if
qty_changes_size.

From-SVN: r7865
parent 80f8f04a
...@@ -165,6 +165,11 @@ static enum reg_class *qty_alternate_class; ...@@ -165,6 +165,11 @@ static enum reg_class *qty_alternate_class;
static rtx *qty_scratch_rtx; static rtx *qty_scratch_rtx;
/* Element Q is nonzero if this quantity has been used in a SUBREG
that changes its size. */
static char *qty_changes_size;
/* Element Q is the register number of one pseudo register whose /* Element Q is the register number of one pseudo register whose
reg_qty value is Q, or -1 is this quantity is for a SCRATCH. This reg_qty value is Q, or -1 is this quantity is for a SCRATCH. This
register should be the head of the chain maintained in reg_next_in_qty. */ register should be the head of the chain maintained in reg_next_in_qty. */
...@@ -289,6 +294,7 @@ alloc_qty (regno, mode, size, birth) ...@@ -289,6 +294,7 @@ alloc_qty (regno, mode, size, birth)
qty_min_class[qty] = reg_preferred_class (regno); qty_min_class[qty] = reg_preferred_class (regno);
qty_alternate_class[qty] = reg_alternate_class (regno); qty_alternate_class[qty] = reg_alternate_class (regno);
qty_n_refs[qty] = reg_n_refs[regno]; qty_n_refs[qty] = reg_n_refs[regno];
qty_changes_size[qty] = reg_changes_size[regno];
} }
/* Similar to `alloc_qty', but allocates a quantity for a SCRATCH rtx /* Similar to `alloc_qty', but allocates a quantity for a SCRATCH rtx
...@@ -378,6 +384,7 @@ alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number) ...@@ -378,6 +384,7 @@ alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number)
qty_min_class[qty] = class; qty_min_class[qty] = class;
qty_alternate_class[qty] = NO_REGS; qty_alternate_class[qty] = NO_REGS;
qty_n_refs[qty] = 1; qty_n_refs[qty] = 1;
qty_changes_size[qty] = 0;
} }
/* Main entry point of this file. */ /* Main entry point of this file. */
...@@ -439,6 +446,7 @@ local_alloc () ...@@ -439,6 +446,7 @@ local_alloc ()
qty_alternate_class qty_alternate_class
= (enum reg_class *) alloca (max_qty * sizeof (enum reg_class)); = (enum reg_class *) alloca (max_qty * sizeof (enum reg_class));
qty_n_refs = (int *) alloca (max_qty * sizeof (int)); qty_n_refs = (int *) alloca (max_qty * sizeof (int));
qty_changes_size = (char *) alloca (max_qty * sizeof (char));
reg_qty = (int *) alloca (max_regno * sizeof (int)); reg_qty = (int *) alloca (max_regno * sizeof (int));
reg_offset = (char *) alloca (max_regno * sizeof (char)); reg_offset = (char *) alloca (max_regno * sizeof (char));
...@@ -1925,6 +1933,9 @@ update_qty_class (qty, reg) ...@@ -1925,6 +1933,9 @@ update_qty_class (qty, reg)
rclass = reg_alternate_class (reg); rclass = reg_alternate_class (reg);
if (reg_class_subset_p (rclass, qty_alternate_class[qty])) if (reg_class_subset_p (rclass, qty_alternate_class[qty]))
qty_alternate_class[qty] = rclass; qty_alternate_class[qty] = rclass;
if (reg_changes_size[reg])
qty_changes_size[qty] = 1;
} }
/* Handle something which alters the value of an rtx REG. /* Handle something which alters the value of an rtx REG.
...@@ -2108,6 +2119,12 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested, ...@@ -2108,6 +2119,12 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested,
SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM); SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM);
#endif #endif
#ifdef CLASS_CANNOT_CHANGE_SIZE
if (qty_changes_size[qty])
IOR_HARD_REG_SET (first_used,
reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE]);
#endif
/* Normally, the registers that can be used for the first register in /* Normally, the registers that can be used for the first register in
a multi-register quantity are the same as those that can be used for a multi-register quantity are the same as those that can be used for
subsequent registers. However, if just trying suggested registers, subsequent registers. However, if just trying suggested registers,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment