summaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-10 18:56:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-10 18:56:37 +0000
commita5647ae846f6765f12a359acba6a71fc12254fa8 (patch)
tree3ca1e4fc718b6a7523af1797005c2a814c34f8d5 /gcc/sel-sched.c
parent026116ce2a4dedad81518b0ca89dd8243b545778 (diff)
Replace call_used_reg_set with call_used_or_fixed_regs
CALL_USED_REGISTERS and call_used_regs infamously contain all fixed registers (hence the need for CALL_REALLY_USED_REGISTERS etc.). We try to recover from this to some extent with: /* Contains 1 for registers that are set or clobbered by calls. */ /* ??? Ideally, this would be just call_used_regs plus global_regs, but for someone's bright idea to have call_used_regs strictly include fixed_regs. Which leaves us guessing as to the set of fixed_regs that are actually preserved. We know for sure that those associated with the local stack frame are safe, but scant others. */ HARD_REG_SET x_regs_invalidated_by_call; Since global registers are added to fixed_reg_set and call_used_reg_set too, it's always the case that: call_used_reg_set == regs_invalidated_by_call | fixed_reg_set This patch replaces all uses of call_used_reg_set with a new macro call_used_or_fixed_regs to make this clearer. This is part of a series that allows call_used_regs to be what is now call_really_used_regs. It's a purely mechanical replacement; later patches clean up obvious oddities like "call_used_or_fixed_regs & ~fixed_regs". 2019-09-10 Richard Sandiford <richard.sandiford@arm.com> gcc/ * hard-reg-set.h (target_hard_regs::x_call_used_reg_set): Delete. (call_used_reg_set): Delete. (call_used_or_fixed_regs): New macro. * reginfo.c (init_reg_sets_1, globalize_reg): Remove initialization of call_used_reg_set. * caller-save.c (setup_save_areas): Use call_used_or_fixed_regs instead of call_used_regs. (save_call_clobbered_regs): Likewise. * cfgcleanup.c (old_insns_match_p): Likewise. * config/c6x/c6x.c (c6x_call_saved_register_used): Likewise. * config/epiphany/epiphany.c (epiphany_conditional_register_usage): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/sh/sh.c (output_stack_adjust): Likewise. * final.c (collect_fn_hard_reg_usage): Likewise. * ira-build.c (ira_build): Likewise. * ira-color.c (calculate_saved_nregs): Likewise. (allocno_reload_assign, calculate_spill_cost): Likewise. * ira-conflicts.c (ira_build_conflicts): Likewise. * ira-costs.c (ira_tune_allocno_costs): Likewise. * ira-lives.c (process_bb_node_lives): Likewise. * ira.c (setup_reg_renumber): Likewise. * lra-assigns.c (find_hard_regno_for_1, lra_assign): Likewise. * lra-constraints.c (need_for_call_save_p): Likewise. (need_for_split_p, inherit_in_ebb): Likewise. * lra-lives.c (process_bb_lives): Likewise. * lra-remat.c (call_used_input_regno_present_p): Likewise. * postreload.c (reload_combine): Likewise. * regrename.c (find_rename_reg): Likewise. * reload1.c (reload_as_needed): Likewise. * rtlanal.c (find_all_hard_reg_sets): Likewise. * sel-sched.c (mark_unavailable_hard_regs): Likewise. * shrink-wrap.c (requires_stack_frame_p): Likewise. From-SVN: r275600
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 9447b922829..e515b1b5e7c 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1224,10 +1224,10 @@ mark_unavailable_hard_regs (def_t def, struct reg_rename *reg_rename_p,
reg_rename_p->unavailable_hard_regs |= sel_hrd.stack_regs;
#endif
- /* If there's a call on this path, make regs from call_used_reg_set
+ /* If there's a call on this path, make regs from call_used_or_fixed_regs
unavailable. */
if (def->crosses_call)
- reg_rename_p->unavailable_hard_regs |= call_used_reg_set;
+ reg_rename_p->unavailable_hard_regs |= call_used_or_fixed_regs;
/* Stop here before reload: we need FRAME_REGS, STACK_REGS, and crosses_call,
but not register classes. */