diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/caller-save.c | 20 | ||||
-rw-r--r-- | gcc/global.c | 10 | ||||
-rw-r--r-- | gcc/reload.h | 4 | ||||
-rw-r--r-- | gcc/reload1.c | 44 | ||||
-rw-r--r-- | gcc/stupid.c | 14 |
6 files changed, 53 insertions, 46 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8e5816c2ab..74d0201b8e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +1999-12-20 Bernd Schmidt <bernds@cygnus.co.uk> + + * reload.h (struct insn_chain): Change live_throughout and dead_or_set + to be of type regset_head, not regset. All users changed by adding + address operator. + * reload1.c (new_insn_chain): Don't allocate regsets, just clear them. + 1999-12-20 Michael Hayes <m.hayes@elec.canterbury.ac.nz> * config/c4x/rtems.h: New file. diff --git a/gcc/caller-save.c b/gcc/caller-save.c index bbd783131d2..ada2935b291 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -379,9 +379,9 @@ save_call_clobbered_regs () /* Use the register life information in CHAIN to compute which regs are live during the call. */ REG_SET_TO_HARD_REG_SET (hard_regs_to_save, - chain->live_throughout); + &chain->live_throughout); compute_use_by_pseudos (&hard_regs_to_save, - chain->live_throughout); + &chain->live_throughout); /* Record all registers set in this call insn. These don't need to be saved. N.B. the call insn might set a subreg of a @@ -618,7 +618,7 @@ insert_restore (chain, before_p, regno, maxrestore) for (k = 0; k < i; k++) { CLEAR_HARD_REG_BIT (hard_regs_saved, regno + k); - SET_REGNO_REG_SET (new->dead_or_set, regno + k); + SET_REGNO_REG_SET (&new->dead_or_set, regno + k); n_regs_saved--; } @@ -687,7 +687,7 @@ insert_save (chain, before_p, regno, to_save) for (k = 0; k < numregs; k++) { SET_HARD_REG_BIT (hard_regs_saved, regno + k); - SET_REGNO_REG_SET (new->dead_or_set, regno + k); + SET_REGNO_REG_SET (&new->dead_or_set, regno + k); n_regs_saved++; } @@ -735,7 +735,7 @@ insert_one_insn (chain, before_p, code, pat) new->insn = emit_insn_before (pat, insn); /* ??? It would be nice if we could exclude the already / still saved registers from the live sets. */ - COPY_REG_SET (new->live_throughout, chain->live_throughout); + COPY_REG_SET (&new->live_throughout, &chain->live_throughout); /* Registers that die in CHAIN->INSN still live in the new insn. */ for (link = REG_NOTES (chain->insn); link; link = XEXP (link, 1)) { @@ -754,10 +754,10 @@ insert_one_insn (chain, before_p, code, pat) continue; for (i = HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1; i >= 0; i--) - SET_REGNO_REG_SET (new->live_throughout, regno + i); + SET_REGNO_REG_SET (&new->live_throughout, regno + i); } } - CLEAR_REG_SET (new->dead_or_set); + CLEAR_REG_SET (&new->dead_or_set); if (chain->insn == BLOCK_HEAD (chain->block)) BLOCK_HEAD (chain->block) = new->insn; } @@ -771,13 +771,13 @@ insert_one_insn (chain, before_p, code, pat) new->insn = emit_insn_after (pat, insn); /* ??? It would be nice if we could exclude the already / still saved registers from the live sets, and observe REG_UNUSED notes. */ - COPY_REG_SET (new->live_throughout, chain->live_throughout); + COPY_REG_SET (&new->live_throughout, &chain->live_throughout); /* Registers that are set in CHAIN->INSN live in the new insn. (Unless there is a REG_UNUSED note for them, but we don't look for them here.) */ note_stores (PATTERN (chain->insn), add_stored_regs, - new->live_throughout); - CLEAR_REG_SET (new->dead_or_set); + &new->live_throughout); + CLEAR_REG_SET (&new->dead_or_set); if (chain->insn == BLOCK_END (chain->block)) BLOCK_END (chain->block) = new->insn; } diff --git a/gcc/global.c b/gcc/global.c index 04058290cc6..420d91b308a 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -1743,7 +1743,7 @@ reg_dies (regno, mode, chain) { CLEAR_REGNO_REG_SET (live_relevant_regs, regno); if (! fixed_regs[regno]) - SET_REGNO_REG_SET (chain->dead_or_set, regno); + SET_REGNO_REG_SET (&chain->dead_or_set, regno); regno++; } } @@ -1751,7 +1751,7 @@ reg_dies (regno, mode, chain) { CLEAR_REGNO_REG_SET (live_relevant_regs, regno); if (reg_renumber[regno] >= 0) - SET_REGNO_REG_SET (chain->dead_or_set, regno); + SET_REGNO_REG_SET (&chain->dead_or_set, regno); } } @@ -1809,15 +1809,15 @@ build_insn_chain (first) reg_dies (REGNO (XEXP (link, 0)), GET_MODE (XEXP (link, 0)), c); - COPY_REG_SET (c->live_throughout, live_relevant_regs); + COPY_REG_SET (&c->live_throughout, live_relevant_regs); /* Mark everything born in this instruction as live. */ note_stores (PATTERN (first), reg_becomes_live, - c->dead_or_set); + &c->dead_or_set); } else - COPY_REG_SET (c->live_throughout, live_relevant_regs); + COPY_REG_SET (&c->live_throughout, live_relevant_regs); if (GET_RTX_CLASS (GET_CODE (first)) == 'i') { diff --git a/gcc/reload.h b/gcc/reload.h index 391c047c882..ebfdbc5f9d1 100644 --- a/gcc/reload.h +++ b/gcc/reload.h @@ -225,8 +225,8 @@ struct insn_chain rtx insn; /* Register life information: record all live hard registers, and all live pseudos that have a hard register. */ - regset live_throughout; - regset dead_or_set; + regset_head live_throughout; + regset_head dead_or_set; /* Copies of the global variables computed by find_reloads. */ struct reload *rld; diff --git a/gcc/reload1.c b/gcc/reload1.c index 2a6f9cc6ae9..366a9a1d869 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -514,8 +514,8 @@ new_insn_chain () { c = (struct insn_chain *) obstack_alloc (&reload_obstack, sizeof (struct insn_chain)); - c->live_throughout = OBSTACK_ALLOC_REG_SET (&reload_obstack); - c->dead_or_set = OBSTACK_ALLOC_REG_SET (&reload_obstack); + INIT_REG_SET (&c->live_throughout); + INIT_REG_SET (&c->dead_or_set); } else { @@ -1295,8 +1295,8 @@ maybe_fix_stack_asms () for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (allowed, i)) { - CLEAR_REGNO_REG_SET (chain->live_throughout, i); - CLEAR_REGNO_REG_SET (chain->dead_or_set, i); + CLEAR_REGNO_REG_SET (&chain->live_throughout, i); + CLEAR_REGNO_REG_SET (&chain->dead_or_set, i); } } @@ -1516,8 +1516,8 @@ order_regs_for_reload (chain) /* Test the various reasons why we can't use a register for spilling in this insn. */ if (fixed_regs[i] - || REGNO_REG_SET_P (chain->live_throughout, i) - || REGNO_REG_SET_P (chain->dead_or_set, i)) + || REGNO_REG_SET_P (&chain->live_throughout, i) + || REGNO_REG_SET_P (&chain->dead_or_set, i)) SET_HARD_REG_BIT (bad_spill_regs, i); } /* Now find out which pseudos are allocated to it, and update @@ -1525,12 +1525,12 @@ order_regs_for_reload (chain) CLEAR_REG_SET (&pseudos_counted); EXECUTE_IF_SET_IN_REG_SET - (chain->live_throughout, FIRST_PSEUDO_REGISTER, j, + (&chain->live_throughout, FIRST_PSEUDO_REGISTER, j, { count_pseudo (j); }); EXECUTE_IF_SET_IN_REG_SET - (chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, + (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, { count_pseudo (j); }); @@ -1645,12 +1645,12 @@ find_reg (chain, order, dumpfile) rl->regno = best_reg; EXECUTE_IF_SET_IN_REG_SET - (chain->live_throughout, FIRST_PSEUDO_REGISTER, j, + (&chain->live_throughout, FIRST_PSEUDO_REGISTER, j, { count_spilled_pseudo (best_reg, rl->nregs, j); }); EXECUTE_IF_SET_IN_REG_SET - (chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, + (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, { count_spilled_pseudo (best_reg, rl->nregs, j); }); @@ -3496,13 +3496,13 @@ finish_spills (global, dumpfile) for (chain = insns_need_reload; chain; chain = chain->next_need_reload) { EXECUTE_IF_SET_IN_REG_SET - (chain->live_throughout, FIRST_PSEUDO_REGISTER, i, + (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i, { ior_hard_reg_set (pseudo_forbidden_regs + i, &chain->used_spill_regs); }); EXECUTE_IF_SET_IN_REG_SET - (chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, + (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, { ior_hard_reg_set (pseudo_forbidden_regs + i, &chain->used_spill_regs); @@ -3535,22 +3535,22 @@ finish_spills (global, dumpfile) HARD_REG_SET used_by_pseudos; HARD_REG_SET used_by_pseudos2; - AND_COMPL_REG_SET (chain->live_throughout, &spilled_pseudos); - AND_COMPL_REG_SET (chain->dead_or_set, &spilled_pseudos); + AND_COMPL_REG_SET (&chain->live_throughout, &spilled_pseudos); + AND_COMPL_REG_SET (&chain->dead_or_set, &spilled_pseudos); /* Mark any unallocated hard regs as available for spills. That makes inheritance work somewhat better. */ if (chain->need_reload) { - REG_SET_TO_HARD_REG_SET (used_by_pseudos, chain->live_throughout); - REG_SET_TO_HARD_REG_SET (used_by_pseudos2, chain->dead_or_set); + REG_SET_TO_HARD_REG_SET (used_by_pseudos, &chain->live_throughout); + REG_SET_TO_HARD_REG_SET (used_by_pseudos2, &chain->dead_or_set); IOR_HARD_REG_SET (used_by_pseudos, used_by_pseudos2); /* Save the old value for the sanity test below. */ COPY_HARD_REG_SET (used_by_pseudos2, chain->used_spill_regs); - compute_use_by_pseudos (&used_by_pseudos, chain->live_throughout); - compute_use_by_pseudos (&used_by_pseudos, chain->dead_or_set); + compute_use_by_pseudos (&used_by_pseudos, &chain->live_throughout); + compute_use_by_pseudos (&used_by_pseudos, &chain->dead_or_set); COMPL_HARD_REG_SET (chain->used_spill_regs, used_by_pseudos); AND_HARD_REG_SET (chain->used_spill_regs, used_spill_regs); @@ -5040,12 +5040,12 @@ choose_reload_regs_init (chain, save_reload_reg_rtx) CLEAR_HARD_REG_SET (reg_used_in_insn); { HARD_REG_SET tmp; - REG_SET_TO_HARD_REG_SET (tmp, chain->live_throughout); + REG_SET_TO_HARD_REG_SET (tmp, &chain->live_throughout); IOR_HARD_REG_SET (reg_used_in_insn, tmp); - REG_SET_TO_HARD_REG_SET (tmp, chain->dead_or_set); + REG_SET_TO_HARD_REG_SET (tmp, &chain->dead_or_set); IOR_HARD_REG_SET (reg_used_in_insn, tmp); - compute_use_by_pseudos (®_used_in_insn, chain->live_throughout); - compute_use_by_pseudos (®_used_in_insn, chain->dead_or_set); + compute_use_by_pseudos (®_used_in_insn, &chain->live_throughout); + compute_use_by_pseudos (®_used_in_insn, &chain->dead_or_set); } for (i = 0; i < reload_n_operands; i++) { diff --git a/gcc/stupid.c b/gcc/stupid.c index a4392e4ab0f..e5727735d1e 100644 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -162,7 +162,7 @@ find_clobbered_regs (reg, setter, data) nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg)); while (nregs-- > 0) { - SET_REGNO_REG_SET (current_chain->live_throughout, regno++); + SET_REGNO_REG_SET (¤t_chain->live_throughout, regno++); } } @@ -285,7 +285,7 @@ stupid_life_analysis (f, nregs, file) chain->insn = insn; for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (regs_live[i]) - SET_REGNO_REG_SET (chain->live_throughout, i); + SET_REGNO_REG_SET (&chain->live_throughout, i); } /* Update which hard regs are currently live @@ -403,14 +403,14 @@ stupid_life_analysis (f, nregs, file) continue; chain = reg_where_dead_chain[i]; - SET_REGNO_REG_SET (chain->dead_or_set, i); + SET_REGNO_REG_SET (&chain->dead_or_set, i); while ((chain = chain->prev) && INSN_SUID (chain->insn) > reg_where_born_exact[i]) - SET_REGNO_REG_SET (chain->live_throughout, i); + SET_REGNO_REG_SET (&chain->live_throughout, i); if (chain) - SET_REGNO_REG_SET (chain->dead_or_set, i); + SET_REGNO_REG_SET (&chain->dead_or_set, i); } if (file) @@ -577,7 +577,7 @@ mark_hard_ref (reg, live_before_p, chain) { if (! fixed_regs[regno+j] && (! live_before_p || ! live[regno+j])) - SET_REGNO_REG_SET (chain->dead_or_set, regno+j); + SET_REGNO_REG_SET (&chain->dead_or_set, regno+j); regs_ever_live[regno+j] = 1; live[regno+j] = live_before_p; } @@ -634,7 +634,7 @@ stupid_mark_refs (x, chain) they do get stored even though never used again. */ MARK_LIVE_AFTER (insn, regno+j); - CLEAR_REGNO_REG_SET (chain->live_throughout, regno + j); + CLEAR_REGNO_REG_SET (&chain->live_throughout, regno + j); /* When a hard reg is clobbered, mark it in use just before this insn, so it is live all through. */ |