From a5647ae846f6765f12a359acba6a71fc12254fa8 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 10 Sep 2019 18:56:37 +0000 Subject: 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 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 --- gcc/reginfo.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gcc/reginfo.c') diff --git a/gcc/reginfo.c b/gcc/reginfo.c index b72a567..026a7bf 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -350,7 +350,6 @@ init_reg_sets_1 (void) /* Initialize "constant" tables. */ CLEAR_HARD_REG_SET (fixed_reg_set); - CLEAR_HARD_REG_SET (call_used_reg_set); CLEAR_HARD_REG_SET (regs_invalidated_by_call); operand_reg_set &= accessible_reg_set; @@ -384,9 +383,6 @@ init_reg_sets_1 (void) if (fixed_regs[i]) SET_HARD_REG_BIT (fixed_reg_set, i); - if (call_used_regs[i]) - SET_HARD_REG_BIT (call_used_reg_set, i); - /* There are a couple of fixed registers that we know are safe to exclude from being clobbered by calls: @@ -426,7 +422,6 @@ init_reg_sets_1 (void) { fixed_regs[i] = call_used_regs[i] = 1; SET_HARD_REG_BIT (fixed_reg_set, i); - SET_HARD_REG_BIT (call_used_reg_set, i); } } @@ -779,7 +774,6 @@ globalize_reg (tree decl, int i) #endif SET_HARD_REG_BIT (fixed_reg_set, i); - SET_HARD_REG_BIT (call_used_reg_set, i); reinit_regs (); } -- cgit v1.1