This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Remove PREDICATE_CODES and SPECIAL_MODE_PREDICATES.


Hi,

Attached is a patch to remove PREDICATE_CODES and
SPECIAL_MODE_PREDICATES as they are unused.

Tested on x86_64-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-07-20  Kazu Hirata  <kazu@cs.umass.edu>

	* gensupport.c (old_preds): Don't reference PREDICATE_CODES.
	(old_special_pred_table): Don't reference
	SPECIAL_MODE_PREDICATES.
	* system.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Poison.
	* config/arc/arc.h: Don't mention PREDICATE_CODES.
	* config/sh/predicates.h: Don't mention
	SPECIAL_MODE_PREDICATES.
	* doc/tm.texi (PREDICATE_CODES, SPECIAL_MODE_PREDICATES):
	Remove.

Index: gensupport.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gensupport.c,v
retrieving revision 1.63
diff -u -d -p -r1.63 gensupport.c
--- gensupport.c	25 Jun 2005 02:00:17 -0000	1.63
+++ gensupport.c	20 Jul 2005 14:30:43 -0000
@@ -1218,10 +1218,7 @@ add_predicate (struct pred_data *pred)
 }
 
 /* This array gives the initial content of the predicate table.  It
-   has entries for all predicates defined in recog.c.  The back end
-   can define PREDICATE_CODES to give additional entries for the
-   table; this is considered an obsolete mechanism (use
-   define_predicate instead).  */
+   has entries for all predicates defined in recog.c.  */
 
 struct old_pred_table
 {
@@ -1251,31 +1248,21 @@ static const struct old_pred_table old_p
   {"indirect_operand", {SUBREG, MEM}},
   {"comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU, GTU,
 			   UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE,
-			   UNLT, LTGT}},
-#ifdef PREDICATE_CODES
-  PREDICATE_CODES
-#endif
+			   UNLT, LTGT}}
 };
 #define NUM_KNOWN_OLD_PREDS ARRAY_SIZE (old_preds)
 
-/* This table gives the initial set of special predicates.  It has
-   entries for all special predicates defined in recog.c.  The back
-   end can define SPECIAL_MODE_PREDICATES to give additional entries
-   for the table; this is considered an obsolete mechanism (use
-   define_special_predicate instead).  */
+/* This table gives the set of special predicates.  It has entries for
+   all special predicates defined in recog.c.  */
 static const char *const old_special_pred_table[] = {
   "address_operand",
   "pmode_register_operand",
-#ifdef SPECIAL_MODE_PREDICATES
-  SPECIAL_MODE_PREDICATES
-#endif
 };
 
 #define NUM_OLD_SPECIAL_MODE_PREDS ARRAY_SIZE (old_special_pred_table)
 
 /* Initialize the table of predicate definitions, starting with
-   the information we have on generic predicates, and the old-style
-   PREDICATE_CODES definitions.  */
+   the information we have on generic predicates.  */
 
 static void
 init_predicate_table (void)
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.261
diff -u -d -p -r1.261 system.h
--- system.h	8 Jul 2005 20:59:48 -0000	1.261
+++ system.h	20 Jul 2005 14:30:43 -0000
@@ -740,7 +740,8 @@ extern void fancy_abort (const char *, i
 	CASE_DROPS_THROUGH TARGET_BELL TARGET_BS TARGET_CR TARGET_DIGIT0   \
         TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT	   \
         LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE		   \
-	TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC
+	TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC	   \
+	PREDICATE_CODES SPECIAL_MODE_PREDICATES
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: config/arc/arc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.h,v
retrieving revision 1.87
diff -u -d -p -r1.87 arc.h
--- config/arc/arc.h	26 Jun 2005 11:42:11 -0000	1.87
+++ config/arc/arc.h	20 Jul 2005 14:30:46 -0000
@@ -23,7 +23,6 @@ Boston, MA 02110-1301, USA.  */
 
 /* Things to do:
 
-   - PREDICATE_CODES
    - incscc, decscc?
    - print active compiler options in assembler output
 */
Index: config/sh/predicates.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/predicates.md,v
retrieving revision 1.4
diff -u -d -p -r1.4 predicates.md
--- config/sh/predicates.md	25 Jun 2005 01:22:25 -0000	1.4
+++ config/sh/predicates.md	20 Jul 2005 14:30:48 -0000
@@ -77,8 +77,8 @@
   return 0;
 })
 
-;; Like arith_reg_dest, but this predicate belongs to
-;; SPECIAL_MODE_PREDICATES.
+;; Like arith_reg_dest, but this predicate is defined with
+;; define_special_predicate, not define_predicate.
 
 (define_special_predicate "any_arith_reg_dest"
   (match_code "subreg,reg")
@@ -86,8 +86,8 @@
   return arith_reg_dest (op, mode);
 })
 
-;; Like register_operand, but this predicate belongs to
-;; SPECIAL_MODE_PREDICATES.
+;; Like register_operand, but this predicate is defined with
+;; define_special_predicate, not define_predicate.
 
 (define_special_predicate "any_register_operand"
   (match_code "subreg,reg")
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.442
diff -u -d -p -r1.442 tm.texi
--- doc/tm.texi	13 Jul 2005 17:27:39 -0000	1.442
+++ doc/tm.texi	20 Jul 2005 14:30:48 -0000
@@ -8667,56 +8667,6 @@ is in effect.  The default is to return 
 @c prevent bad page break with this line
 Here are several miscellaneous parameters.
 
-@defmac PREDICATE_CODES
-Define this if you have defined special-purpose predicates in the file
-@file{@var{machine}.c}.  This macro is called within an initializer of an
-array of structures.  The first field in the structure is the name of a
-predicate and the second field is an array of rtl codes.  For each
-predicate, list all rtl codes that can be in expressions matched by the
-predicate.  The list should have a trailing comma.  Here is an example
-of two entries in the list for a typical RISC machine:
-
-@smallexample
-#define PREDICATE_CODES \
-  @{"gen_reg_rtx_operand", @{SUBREG, REG@}@},  \
-  @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@},
-@end smallexample
-
-Defining this macro does not affect the generated code (however,
-incorrect definitions that omit an rtl code that may be matched by the
-predicate can cause the compiler to malfunction).  Instead, it allows
-the table built by @file{genrecog} to be more compact and efficient,
-thus speeding up the compiler.  The most important predicates to include
-in the list specified by this macro are those used in the most insn
-patterns.
-
-For each predicate function named in @code{PREDICATE_CODES}, a
-declaration will be generated in @file{insn-codes.h}.
-
-Use of this macro is deprecated; use @code{define_predicate} instead.
-@xref{Defining Predicates}.
-@end defmac
-
-@defmac SPECIAL_MODE_PREDICATES
-Define this if you have special predicates that know special things
-about modes.  Genrecog will warn about certain forms of
-@code{match_operand} without a mode; if the operand predicate is
-listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
-suppressed.
-
-Here is an example from the IA-32 port (@code{ext_register_operand}
-specially checks for @code{HImode} or @code{SImode} in preparation
-for a byte extraction from @code{%ah} etc.).
-
-@smallexample
-#define SPECIAL_MODE_PREDICATES \
-  "ext_register_operand",
-@end smallexample
-
-Use of this macro is deprecated; use @code{define_special_predicate}
-instead.  @xref{Defining Predicates}.
-@end defmac
-
 @defmac HAS_LONG_COND_BRANCH
 Define this boolean macro to indicate whether or not your architecture
 has conditional branches that can span all of memory.  It is used in


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]