[PATCH] Remove unused functions from sparc backend.

David Miller davem@davemloft.net
Sat Oct 22 14:44:00 GMT 2011


All uses of reg_unused_after() were removed in my rewrite of the sparc
backend back in 1998.

short_branch() was removed in various pieces over time, the final references
died in Eric B.'s removal of -mflat in 2004.

Committed to trunk.

gcc/

	* config/sparc/sparc.c (short_branch, reg_unused_after): Delete.
	* config/sparc/sparc-protos.h (short_branch, reg_unused_after):
	Get rid of declarations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180325 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                   |    4 +++
 gcc/config/sparc/sparc-protos.h |    2 -
 gcc/config/sparc/sparc.c        |   45 ---------------------------------------
 3 files changed, 4 insertions(+), 47 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a09af51..269c1cd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -10,6 +10,10 @@
 	* config/sparc/sparc.c (struct processor_costs): To here.
 	(sparc_costs): Mark static.
 
+	* config/sparc/sparc.c (short_branch, reg_unused_after): Delete.
+	* config/sparc/sparc-protos.h (short_branch, reg_unused_after):
+	Get rid of declarations.
+
 2011-10-21  Paul Brook  <paul@codesourcery.com>
 
 	* config/c6x/c6x.c (c6x_asm_emit_except_personality,
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 4b15b82..2890532 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -43,7 +43,6 @@ extern void sparc_expand_epilogue (bool);
 extern void sparc_flat_expand_epilogue (bool);
 extern bool sparc_can_use_return_insn_p (void);
 extern int check_pic (int);
-extern int short_branch (int, int);
 extern void sparc_profile_hook (int);
 extern void sparc_override_options (void);
 extern void sparc_output_scratch_registers (FILE *);
@@ -95,7 +94,6 @@ extern int fp_mov_p (rtx);
 extern int fp_high_losum_p (rtx);
 extern int mem_min_alignment (rtx, int);
 extern int pic_address_needs_scratch (rtx);
-extern int reg_unused_after (rtx, rtx);
 extern int register_ok_for_ldd (rtx);
 extern int memory_ok_for_ldd (rtx);
 extern int registers_ok_for_ldd_peep (rtx, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 717594d..ba88315 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -3176,51 +3176,6 @@ eligible_for_sibcall_delay (rtx trial)
 
   return eligible_for_restore_insn (trial, false);
 }
-
-int
-short_branch (int uid1, int uid2)
-{
-  int delta = INSN_ADDRESSES (uid1) - INSN_ADDRESSES (uid2);
-
-  /* Leave a few words of "slop".  */
-  if (delta >= -1023 && delta <= 1022)
-    return 1;
-
-  return 0;
-}
-
-/* Return nonzero if REG is not used after INSN.
-   We assume REG is a reload reg, and therefore does
-   not live past labels or calls or jumps.  */
-int
-reg_unused_after (rtx reg, rtx insn)
-{
-  enum rtx_code code, prev_code = UNKNOWN;
-
-  while ((insn = NEXT_INSN (insn)))
-    {
-      if (prev_code == CALL_INSN && call_used_regs[REGNO (reg)])
-	return 1;
-
-      code = GET_CODE (insn);
-      if (GET_CODE (insn) == CODE_LABEL)
-	return 1;
-
-      if (INSN_P (insn))
-	{
-	  rtx set = single_set (insn);
-	  int in_src = set && reg_overlap_mentioned_p (reg, SET_SRC (set));
-	  if (set && in_src)
-	    return 0;
-	  if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
-	    return 1;
-	  if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
-	    return 0;
-	}
-      prev_code = code;
-    }
-  return 1;
-}
 
 /* Determine if it's legal to put X into the constant pool.  This
    is not possible if X contains the address of a symbol that is
-- 
1.7.6.401.g6a319



More information about the Gcc-patches mailing list