This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove unused function replace_symbols_in_block from arm.c
- From: Ian Lance Taylor <ian at airs dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 2 Apr 2005 12:12:12 -0500
- Subject: Remove unused function replace_symbols_in_block from arm.c
The function replace_symbols_in_block is static in arm.c and is never
called or used by anything. However, gcc does not warn about it being
unused because it calls itself recursively.
replace_symbols_in_block was present in the initial check in of
thumb.c by Nick Clifton on 1998-03-25. The function was only called
by thumb_reorg. thumb.c, including replace_symbols_in_block, was then
copied into arm.c on the branch merged-arm-thumb-backend-branch by
Richard Earnshaw on 1999-10-26. At that time thumb_reorg was deleted,
and there was no remaining call to replace_symbols_in_block. That
branch was merged into mainline by Richard Earnshaw on 2000-04-08. So
the function has been unneeded for a long time.
This patch removes it. Tested by rebuilding the ARM compiler. OK for
mainline?
Ian
2005-04-02 Ian Lance Taylor <ian@airs.com>
* config/arm/arm.c (replace_symbols_in_block): Remove static
function.
Index: arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.432
diff -u -r1.432 arm.c
--- arm.c 29 Mar 2005 03:00:23 -0000 1.432
+++ arm.c 2 Apr 2005 17:09:40 -0000
@@ -84,7 +84,6 @@
int, HOST_WIDE_INT);
static const char *shift_op (rtx, HOST_WIDE_INT *);
static struct machine_function *arm_init_machine_status (void);
-static void replace_symbols_in_block (tree, rtx, rtx);
static void thumb_exit (FILE *, int);
static rtx is_jump_table (rtx);
static HOST_WIDE_INT get_jump_table_size (rtx);
@@ -12358,37 +12357,6 @@
return NULL_RTX;
}
-/* Recursively search through all of the blocks in a function
- checking to see if any of the variables created in that
- function match the RTX called 'orig'. If they do then
- replace them with the RTX called 'new'. */
-static void
-replace_symbols_in_block (tree block, rtx orig, rtx new)
-{
- for (; block; block = BLOCK_CHAIN (block))
- {
- tree sym;
-
- if (!TREE_USED (block))
- continue;
-
- for (sym = BLOCK_VARS (block); sym; sym = TREE_CHAIN (sym))
- {
- if ( (DECL_NAME (sym) == 0 && TREE_CODE (sym) != TYPE_DECL)
- || DECL_IGNORED_P (sym)
- || TREE_CODE (sym) != VAR_DECL
- || DECL_EXTERNAL (sym)
- || !rtx_equal_p (DECL_RTL (sym), orig)
- )
- continue;
-
- SET_DECL_RTL (sym, new);
- }
-
- replace_symbols_in_block (BLOCK_SUBBLOCKS (block), orig, new);
- }
-}
-
/* Return the number (counting from 0) of
the least significant set bit in MASK. */