aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-30 16:20:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-30 16:20:08 +0000
commit7392e5d8888462610b5536c2894d2923b826faed (patch)
tree2b67d39abfa07cbc037a4b97e98d34bee0fd5134
parent737d6a1a1745bdd4041e73800a842a1086967d5d (diff)
downloadgcc-7392e5d8888462610b5536c2894d2923b826faed.zip
gcc-7392e5d8888462610b5536c2894d2923b826faed.tar.gz
gcc-7392e5d8888462610b5536c2894d2923b826faed.tar.bz2
Remove global call sets: caller-save.c
All caller-save.c uses of "|= fixed_reg_set" added in a previous patch were redundant, since the sets are later ANDed with ~fixed_reg_set. 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> gcc/ * caller-save.c (setup_save_areas): Remove redundant |s of fixed_reg_set. (save_call_clobbered_regs): Likewise. Use the call ABI rather than call_used_or_fixed_regs to decide whether a REG_RETURNED value is useful. From-SVN: r276313
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/caller-save.c17
2 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86caf6e..d912a87 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
+ * caller-save.c (setup_save_areas): Remove redundant |s of
+ fixed_reg_set.
+ (save_call_clobbered_regs): Likewise. Use the call ABI rather
+ than call_used_or_fixed_regs to decide whether a REG_RETURNED
+ value is useful.
+
+2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
+
* rtl.h (predefined_function_abi): Declare.
(choose_hard_reg_mode): Take a pointer to a predefined_function_abi
instead of a boolean call_save flag.
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 10b6737..6945387 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -428,8 +428,6 @@ setup_save_areas (void)
REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
&chain->live_throughout);
used_regs = insn_callee_abi (insn).full_reg_clobbers ();
- /* ??? This preserves traditional behavior; it might not be needed. */
- used_regs |= fixed_reg_set;
/* Record all registers set in this call insn. These don't
need to be saved. N.B. the call insn might set a subreg
@@ -513,9 +511,6 @@ setup_save_areas (void)
REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
&chain->live_throughout);
used_regs = insn_callee_abi (insn).full_reg_clobbers ();
- /* ??? This preserves traditional behavior; it might not
- be needed. */
- used_regs |= fixed_reg_set;
/* Record all registers set in this call insn. These don't
need to be saved. N.B. the call insn might set a subreg
@@ -793,7 +788,6 @@ save_call_clobbered_regs (void)
{
unsigned regno;
HARD_REG_SET hard_regs_to_save;
- HARD_REG_SET call_def_reg_set;
reg_set_iterator rsi;
rtx cheap;
@@ -840,15 +834,12 @@ save_call_clobbered_regs (void)
note_stores (insn, mark_set_regs, &this_insn_sets);
/* Compute which hard regs must be saved before this call. */
+ function_abi callee_abi = insn_callee_abi (insn);
hard_regs_to_save &= ~(fixed_reg_set
| this_insn_sets
| hard_regs_saved);
hard_regs_to_save &= savable_regs;
- call_def_reg_set = insn_callee_abi (insn).full_reg_clobbers ();
- /* ??? This preserves traditional behavior; it might not
- be needed. */
- call_def_reg_set |= fixed_reg_set;
- hard_regs_to_save &= call_def_reg_set;
+ hard_regs_to_save &= callee_abi.full_reg_clobbers ();
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
@@ -863,8 +854,8 @@ save_call_clobbered_regs (void)
if (cheap
&& HARD_REGISTER_P (cheap)
- && TEST_HARD_REG_BIT (call_used_or_fixed_regs,
- REGNO (cheap)))
+ && callee_abi.clobbers_reg_p (GET_MODE (cheap),
+ REGNO (cheap)))
{
rtx dest, newpat;
rtx pat = PATTERN (insn);