This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove some more unused code from ia64 back end.
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: "James E. Wilson" <wilson at specifixinc dot com>
- Date: Thu, 29 Jul 2004 11:30:07 -0700
- Subject: Remove some more unused code from ia64 back end.
1) setjmp_operand is unused and appears never to have been used.
2) There is a block of code in got_symbolic_operand which is
unreachable, and has been so since July 2000. I conclude it's not
necessary. It can be pulled back out of CVS if we do want it.
3) It is not necessary to write explicit prototypes in ia64-protos.h
for predicate functions. Removing them revealed that
tls_symbolic_operand had been left out of PREDICATE_CODES. (Which
is harmless, because tls_symbolic_operand is never used directly in
a match_operand expression, but it seems cleanest to me to list
everything that has the form of an operand predicate.)
Bootstrapped ia64-hpux11.23.
zw
* config/ia64/ia64.c (setjmp_operand): Delete, unused.
(got_symbolic_operand): Remove unreachable code.
* config/ia64/ia64.h (PREDICATE_CODES): Remove entry for
setjmp_operand; add entry for tls_symbolic_operand.
* config/ia64/ia64-protos.h: Remove all prototypes of
predicate functions.
===================================================================
Index: config/ia64/ia64.c
--- config/ia64/ia64.c 29 Jul 2004 07:37:14 -0000 1.312
+++ config/ia64/ia64.c 29 Jul 2004 18:19:46 -0000
@@ -479,22 +479,7 @@ got_symbolic_operand (rtx op, enum machi
op = XEXP (op, 1);
if (GET_CODE (op) != CONST_INT)
return 0;
-
- return 1;
-
- /* Ok if we're not using GOT entries at all. */
- if (TARGET_NO_PIC || TARGET_AUTO_PIC)
- return 1;
-
- /* "Ok" while emitting rtl, since otherwise we won't be provided
- with the entire offset during emission, which makes it very
- hard to split the offset into high and low parts. */
- if (currently_expanding_to_rtl)
- return 1;
-
- /* Force the low 14 bits of the constant to zero so that we do not
- use up so many GOT entries. */
- return (INTVAL (op) & 0x3fff) == 0;
+ return 1;
case SYMBOL_REF:
if (SYMBOL_REF_SMALL_ADDR_P (op))
@@ -548,54 +533,6 @@ function_operand (rtx op, enum machine_m
return 0;
}
-/* Return 1 if OP is setjmp or a similar function. */
-
-/* ??? This is an unsatisfying solution. Should rethink. */
-
-int
-setjmp_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- const char *name;
- int retval = 0;
-
- if (GET_CODE (op) != SYMBOL_REF)
- return 0;
-
- name = XSTR (op, 0);
-
- /* The following code is borrowed from special_function_p in calls.c. */
-
- /* Disregard prefix _, __ or __x. */
- if (name[0] == '_')
- {
- if (name[1] == '_' && name[2] == 'x')
- name += 3;
- else if (name[1] == '_')
- name += 2;
- else
- name += 1;
- }
-
- if (name[0] == 's')
- {
- retval
- = ((name[1] == 'e'
- && (! strcmp (name, "setjmp")
- || ! strcmp (name, "setjmp_syscall")))
- || (name[1] == 'i'
- && ! strcmp (name, "sigsetjmp"))
- || (name[1] == 'a'
- && ! strcmp (name, "savectx")));
- }
- else if ((name[0] == 'q' && name[1] == 's'
- && ! strcmp (name, "qsetjmp"))
- || (name[0] == 'v' && name[1] == 'f'
- && ! strcmp (name, "vfork")))
- retval = 1;
-
- return retval;
-}
-
/* Return 1 if OP is a general operand, excluding tls symbolic operands. */
int
===================================================================
Index: config/ia64/ia64.h
--- config/ia64/ia64.h 27 Jul 2004 21:41:20 -0000 1.184
+++ config/ia64/ia64.h 29 Jul 2004 18:19:46 -0000
@@ -2150,8 +2150,8 @@ do { \
{ "sdata_symbolic_operand", {SYMBOL_REF, CONST}}, \
{ "small_addr_symbolic_operand", {SYMBOL_REF}}, \
{ "symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
+{ "tls_symbolic_operand", {SYMBOL_REF}}, \
{ "function_operand", {SYMBOL_REF}}, \
-{ "setjmp_operand", {SYMBOL_REF}}, \
{ "destination_operand", {SUBREG, REG, MEM}}, \
{ "not_postinc_memory_operand", {MEM}}, \
{ "move_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
===================================================================
Index: config/ia64/ia64-protos.h
--- config/ia64/ia64-protos.h 14 Jul 2004 06:24:15 -0000 1.65
+++ config/ia64/ia64-protos.h 29 Jul 2004 18:19:46 -0000
@@ -33,47 +33,6 @@ extern int bundling_p;
extern int ia64_st_address_bypass_p (rtx, rtx);
extern int ia64_ld_address_bypass_p (rtx, rtx);
extern int ia64_produce_address_p (rtx);
-extern int call_operand (rtx, enum machine_mode);
-extern int sdata_symbolic_operand (rtx, enum machine_mode);
-extern int got_symbolic_operand (rtx, enum machine_mode);
-extern int symbolic_operand (rtx, enum machine_mode);
-extern int tls_symbolic_operand (rtx, enum machine_mode);
-extern int function_operand (rtx, enum machine_mode);
-extern int setjmp_operand (rtx, enum machine_mode);
-extern int move_operand (rtx, enum machine_mode);
-extern int gr_register_operand (rtx, enum machine_mode);
-extern int fr_register_operand (rtx, enum machine_mode);
-extern int grfr_register_operand (rtx, enum machine_mode);
-extern int gr_nonimmediate_operand (rtx, enum machine_mode);
-extern int fr_nonimmediate_operand (rtx, enum machine_mode);
-extern int grfr_nonimmediate_operand (rtx, enum machine_mode);
-extern int gr_reg_or_0_operand (rtx, enum machine_mode);
-extern int gr_reg_or_5bit_operand (rtx, enum machine_mode);
-extern int gr_reg_or_6bit_operand (rtx, enum machine_mode);
-extern int gr_reg_or_8bit_operand (rtx, enum machine_mode);
-extern int grfr_reg_or_8bit_operand (rtx, enum machine_mode);
-extern int gr_reg_or_8bit_adjusted_operand (rtx, enum machine_mode);
-extern int gr_reg_or_8bit_and_adjusted_operand (rtx, enum machine_mode);
-extern int gr_reg_or_14bit_operand (rtx, enum machine_mode);
-extern int gr_reg_or_22bit_operand (rtx, enum machine_mode);
-extern int shift_count_operand (rtx, enum machine_mode);
-extern int shift_32bit_count_operand (rtx, enum machine_mode);
-extern int shladd_operand (rtx, enum machine_mode);
-extern int fetchadd_operand (rtx, enum machine_mode);
-extern int fr_reg_or_fp01_operand (rtx, enum machine_mode);
-extern int normal_comparison_operator (rtx, enum machine_mode);
-extern int adjusted_comparison_operator (rtx, enum machine_mode);
-extern int signed_inequality_operator (rtx, enum machine_mode);
-extern int destination_operand (rtx, enum machine_mode);
-extern int not_postinc_memory_operand (rtx, enum machine_mode);
-extern int predicate_operator (rtx, enum machine_mode);
-extern int ar_lc_reg_operand (rtx, enum machine_mode);
-extern int ar_ccv_reg_operand (rtx, enum machine_mode);
-extern int ar_pfs_reg_operand (rtx, enum machine_mode);
-extern int general_xfmode_operand (rtx, enum machine_mode);
-extern int destination_xfmode_operand (rtx, enum machine_mode);
-extern int xfreg_or_fp01_operand (rtx, enum machine_mode);
-extern int basereg_operand (rtx, enum machine_mode);
extern rtx ia64_expand_move (rtx, rtx);
extern int ia64_move_ok (rtx, rtx);