Drop unused parameter of insert_save()
diff mbox series

Message ID CAD485jh4B5wA5k-nZYfgjDCeouB1PGA0Eoh9TANVQjG3T_qO2g@mail.gmail.com
State New
Headers show
Series
  • Drop unused parameter of insert_save()
Related show

Commit Message

A. Skrobov Jan. 15, 2018, 9:25 p.m. UTC
The only caller passes `before_p=1`, and I cannot imagine a use case
for it with `before_p=0`

2018-01-15  Artyom Skrobov tyomitch@gmail.com

        * caller-save.c: Drop unused parameter of insert_save()

---
 gcc/caller-save.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

   int i;
@@ -1314,7 +1314,7 @@ insert_save (struct insn_chain *chain, int
before_p, int regno,

   pat = gen_rtx_SET (mem, gen_rtx_REG (GET_MODE (mem), regno));
   code = reg_save_code (regno, GET_MODE (mem));
-  new_chain = insert_one_insn (chain, before_p, code, pat);
+  new_chain = insert_one_insn (chain, 1, code, pat);

   /* Set hard_regs_saved and dead_or_set for all the registers we saved.  */
   for (k = 0; k < numregs; k++)

Comments

Jeff Law Jan. 16, 2018, 6:50 a.m. UTC | #1
On 01/15/2018 02:25 PM, A. Skrobov wrote:
> The only caller passes `before_p=1`, and I cannot imagine a use case
> for it with `before_p=0`
> 
> 2018-01-15  Artyom Skrobov tyomitch@gmail.com
> 
>         * caller-save.c: Drop unused parameter of insert_save()
THanks.  I've thrown this into the overnight tester and will commit
tomorrow assuming it passes (which I expect it will).

jeff

Patch
diff mbox series

diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index df1c9691e0c2..db1ab2caee9a 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -88,7 +88,7 @@  static void mark_set_regs (rtx, const_rtx, void *);
 static void mark_referenced_regs (rtx *, refmarker_fn *mark, void *mark_arg);
 static refmarker_fn mark_reg_as_referenced;
 static refmarker_fn replace_reg_with_saved_mem;
-static int insert_save (struct insn_chain *, int, int, HARD_REG_SET *,
+static int insert_save (struct insn_chain *, int, HARD_REG_SET *,
  machine_mode *);
 static int insert_restore (struct insn_chain *, int, int, int,
    machine_mode *);
@@ -861,7 +861,7 @@  save_call_clobbered_regs (void)

       for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
  if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
-  regno += insert_save (chain, 1, regno, &hard_regs_to_save, save_mode);
+  regno += insert_save (chain, regno, &hard_regs_to_save, save_mode);

       /* Must recompute n_regs_saved.  */
       n_regs_saved = 0;
@@ -1252,7 +1252,7 @@  insert_restore (struct insn_chain *chain, int
before_p, int regno,
 /* Like insert_restore above, but save registers instead.  */

 static int
-insert_save (struct insn_chain *chain, int before_p, int regno,
+insert_save (struct insn_chain *chain, int regno,
      HARD_REG_SET *to_save, machine_mode *save_mode)
 {