summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-08-07 12:51:35 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-08-07 12:51:35 +0000
commit43ce486f9ee63b9794cc5d315fe3abe75fa4b550 (patch)
tree8009b1a9099b53491838e129da2a592308226d62 /gcc/local-alloc.c
parent2ed76ddf79718e274d67c0b80ab7b61a022a6801 (diff)
downloadgcc-43ce486f9ee63b9794cc5d315fe3abe75fa4b550.tar.gz
(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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7865 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 3b2d81ecf9b..f7774e0e751 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -165,6 +165,11 @@ static enum reg_class *qty_alternate_class;
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
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. */
@@ -289,6 +294,7 @@ alloc_qty (regno, mode, size, birth)
qty_min_class[qty] = reg_preferred_class (regno);
qty_alternate_class[qty] = reg_alternate_class (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
@@ -378,6 +384,7 @@ alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number)
qty_min_class[qty] = class;
qty_alternate_class[qty] = NO_REGS;
qty_n_refs[qty] = 1;
+ qty_changes_size[qty] = 0;
}
/* Main entry point of this file. */
@@ -439,6 +446,7 @@ local_alloc ()
qty_alternate_class
= (enum reg_class *) alloca (max_qty * sizeof (enum reg_class));
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_offset = (char *) alloca (max_regno * sizeof (char));
@@ -1925,6 +1933,9 @@ update_qty_class (qty, reg)
rclass = reg_alternate_class (reg);
if (reg_class_subset_p (rclass, qty_alternate_class[qty]))
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.
@@ -2108,6 +2119,12 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested,
SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM);
#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
a multi-register quantity are the same as those that can be used for
subsequent registers. However, if just trying suggested registers,