aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-05-22 19:33:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-05-22 19:33:37 +0000
commit56b138aed218de6e61416f2615424800ff7a0d18 (patch)
treecfa4aaeabd4b1bbd0608b1fb3976bc0540f8ed3a /gcc/local-alloc.c
parent965ff67081ef58732db2256a1acba5cc3bb986be (diff)
downloadgcc-56b138aed218de6e61416f2615424800ff7a0d18.zip
gcc-56b138aed218de6e61416f2615424800ff7a0d18.tar.gz
gcc-56b138aed218de6e61416f2615424800ff7a0d18.tar.bz2
hard-reg-set.h (GO_IF_HARD_REG_SUBSET, [...]): Delete in favor of...
gcc/ * hard-reg-set.h (GO_IF_HARD_REG_SUBSET, GO_IF_HARD_REG_EQUAL): Delete in favor of... (hard_reg_subset_p, hard_reg_sets_equal_p, hard_reg_sets_intersect_p) (hard_reg_set_empty_p): ...these new functions. * bt-load.c (choose_btr): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * cfgcleanup.c (old_insns_match_p): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * df-problems.c (df_urec_local_compute): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_EQUAL. * global.c (find_reg): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_SUBSET. (modify_reg_pav): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_EQUAL. * local-alloc.c (find_free_reg): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * reg-stack.c (change_stack, convert_regs_1): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * regclass.c (init_reg_sets_1, reg_scan_mark_refs): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. (reg_classes_intersect_p): Use hard_reg_sets_intersect_p instead of GO_IF_HARD_REG_SUBSET, * reload1.c (finish_spills): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * struct-equiv.c (death_notes_match_p): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * config/sh/sh.c (push_regs, calc_live_regs): Use hard_reg_sets_intersect_p instead of hard_regs_intersect_p. (hard_regs_intersect_p): Delete. From-SVN: r124954
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index f46b9c9..cd1c01d 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -2286,42 +2286,40 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno,
IOR_COMPL_HARD_REG_SET (first_used, qty_phys_sugg[qtyno]);
}
- /* If all registers are excluded, we can't do anything. */
- GO_IF_HARD_REG_SUBSET (reg_class_contents[(int) ALL_REGS], first_used, fail);
-
/* If at least one would be suitable, test each hard reg. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
+ if (!hard_reg_set_subset_p (reg_class_contents[(int) ALL_REGS], first_used))
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
#ifdef REG_ALLOC_ORDER
- int regno = reg_alloc_order[i];
+ int regno = reg_alloc_order[i];
#else
- int regno = i;
+ int regno = i;
#endif
- if (! TEST_HARD_REG_BIT (first_used, regno)
- && HARD_REGNO_MODE_OK (regno, mode)
- && (qty[qtyno].n_calls_crossed == 0
- || accept_call_clobbered
- || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
- {
- int j;
- int size1 = hard_regno_nregs[regno][mode];
- for (j = 1; j < size1 && ! TEST_HARD_REG_BIT (used, regno + j); j++);
- if (j == size1)
- {
- /* Mark that this register is in use between its birth and death
- insns. */
- post_mark_life (regno, mode, 1, born_index, dead_index);
- return regno;
- }
+ if (!TEST_HARD_REG_BIT (first_used, regno)
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (qty[qtyno].n_calls_crossed == 0
+ || accept_call_clobbered
+ || !HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ {
+ int j;
+ int size1 = hard_regno_nregs[regno][mode];
+ j = 1;
+ while (j < size1 && !TEST_HARD_REG_BIT (used, regno + j))
+ j++;
+ if (j == size1)
+ {
+ /* Mark that this register is in use between its birth
+ and death insns. */
+ post_mark_life (regno, mode, 1, born_index, dead_index);
+ return regno;
+ }
#ifndef REG_ALLOC_ORDER
- /* Skip starting points we know will lose. */
- i += j;
+ /* Skip starting points we know will lose. */
+ i += j;
#endif
- }
- }
+ }
+ }
- fail:
/* If we are just trying suggested register, we have just tried copy-
suggested registers, and there are arithmetic-suggested registers,
try them. */