[patch] emit-rtl.c: Remove copy_most_rtx.
Kazu Hirata
kazu@cs.umass.edu
Sun Nov 7 17:54:00 GMT 2004
Hi,
Attached is a patch to remove copy_most_rtx as is unused.
Bootstrapped on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2004-11-07 Kazu Hirata <kazu@cs.umass.edu>
* emit-rtl.c (copy_most_rtx): Remove.
* rtl.h: Remove the corresponding prototype.
Index: emit-rtl.c
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/emit-rtl.c,v
retrieving revision 1.422
diff -u -d -p -r1.422 emit-rtl.c
--- emit-rtl.c 27 Oct 2004 01:36:11 -0000 1.422
+++ emit-rtl.c 7 Nov 2004 06:46:50 -0000
@@ -2371,105 +2371,6 @@ reset_used_decls (tree blk)
reset_used_decls (t);
}
-/* Similar to `copy_rtx' except that if MAY_SHARE is present, it is
- placed in the result directly, rather than being copied. MAY_SHARE is
- either a MEM of an EXPR_LIST of MEMs. */
-
-rtx
-copy_most_rtx (rtx orig, rtx may_share)
-{
- rtx copy;
- int i, j;
- RTX_CODE code;
- const char *format_ptr;
-
- if (orig == may_share
- || (GET_CODE (may_share) == EXPR_LIST
- && in_expr_list_p (may_share, orig)))
- return orig;
-
- code = GET_CODE (orig);
-
- switch (code)
- {
- case REG:
- case CONST_INT:
- case CONST_DOUBLE:
- case CONST_VECTOR:
- case SYMBOL_REF:
- case CODE_LABEL:
- case PC:
- case CC0:
- return orig;
- default:
- break;
- }
-
- copy = rtx_alloc (code);
- PUT_MODE (copy, GET_MODE (orig));
- RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
- RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
- RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
- RTX_FLAG (copy, frame_related) = RTX_FLAG (orig, frame_related);
- RTX_FLAG (copy, return_val) = RTX_FLAG (orig, return_val);
-
- format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
-
- for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++)
- {
- switch (*format_ptr++)
- {
- case 'e':
- XEXP (copy, i) = XEXP (orig, i);
- if (XEXP (orig, i) != NULL && XEXP (orig, i) != may_share)
- XEXP (copy, i) = copy_most_rtx (XEXP (orig, i), may_share);
- break;
-
- case 'u':
- XEXP (copy, i) = XEXP (orig, i);
- break;
-
- case 'E':
- case 'V':
- XVEC (copy, i) = XVEC (orig, i);
- if (XVEC (orig, i) != NULL)
- {
- XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i));
- for (j = 0; j < XVECLEN (copy, i); j++)
- XVECEXP (copy, i, j)
- = copy_most_rtx (XVECEXP (orig, i, j), may_share);
- }
- break;
-
- case 'w':
- XWINT (copy, i) = XWINT (orig, i);
- break;
-
- case 'n':
- case 'i':
- XINT (copy, i) = XINT (orig, i);
- break;
-
- case 't':
- XTREE (copy, i) = XTREE (orig, i);
- break;
-
- case 's':
- case 'S':
- XSTR (copy, i) = XSTR (orig, i);
- break;
-
- case '0':
- X0ANY (copy, i) = X0ANY (orig, i);
- break;
-
- default:
- gcc_unreachable ();
- }
- }
- return copy;
-}
-
/* Mark ORIG as in use, and return a copy of it if it was already in use.
Recursively does the same for subexpressions. Uses
copy_rtx_if_shared_1 to reduce stack space. */
Index: rtl.h
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/rtl.h,v
retrieving revision 1.519
diff -u -d -p -r1.519 rtl.h
--- rtl.h 4 Nov 2004 23:24:46 -0000 1.519
+++ rtl.h 7 Nov 2004 06:46:50 -0000
@@ -1387,7 +1387,6 @@ extern void dump_rtx_statistics (void);
extern rtx copy_rtx_if_shared (rtx);
/* In rtl.c */
-extern rtx copy_most_rtx (rtx, rtx);
extern rtx shallow_copy_rtx_stat (rtx MEM_STAT_DECL);
#define shallow_copy_rtx(a) shallow_copy_rtx_stat (a MEM_STAT_INFO)
extern int rtx_equal_p (rtx, rtx);
More information about the Gcc-patches
mailing list