public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH INSTALLED]: const typedefs part 3/N
@ 2007-07-25 18:42 Kaveh R. GHAZI
  0 siblings, 0 replies; only message in thread
From: Kaveh R. GHAZI @ 2007-07-25 18:42 UTC (permalink / raw)
  To: gcc-patches

This patch starts using const_rtx.

Tested on sparc-sun-solaris2.10, no regressions.  Installed.

		--Kaveh


2007-07-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* cfglayout.c (insn_scope, insn_line): Constify.
	* emit-rtl.c (const_int_htab_hash, const_int_htab_eq,
	const_double_htab_hash, const_double_htab_eq,
	mem_attrs_htab_hash): Likewise.
	* loop-iv.c (biv_eq): Likewise.
	* print-rtl.c (print_rtx, print_decl_name, print_mem_expr,
	print_inline_rtx, debug_rtx, debug_rtx_list, debug_rtx_range,
	debug_rtx_find, print_rtl, print_rtl_single, print_simple_rtl):
	Likewise.
	* rtl-error.c (location_for_asm, diagnostic_for_asm,
	error_for_asm, warning_for_asm, _fatal_insn,
	_fatal_insn_not_found): Likewise.
	* rtl.c (rtx_size, shared_const_p, shallow_copy_rtx_stat,
	rtx_equal_p, rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtl_check_failed_code1,
	rtl_check_failed_code2, rtl_check_failed_code_mode,
	rtvec_check_failed_bounds, rtl_check_failed_flag): Likewise.
	* rtl.h (rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtl_check_failed_code1,
	rtl_check_failed_code2, rtl_check_failed_code_mode,
	rtvec_check_failed_bounds, rtl_check_failed_flag, LABEL_KIND,
	SET_LABEL_KIND, rhs_regno, subreg_lsb, subreg_regno, subreg_nregs,
	shared_const_p, rtx_size, shallow_copy_rtx_stat, rtx_equal_p,
	get_pool_mode, insn_line, insn_file, simplify_replace_rtx,
	mode_signbit_p, rtx_addr_can_trap_p, nonzero_address_p,
	rtx_unstable_p, get_integer_term, get_related_value,
	offset_within_block_p, reg_mentioned_p, count_occurrences,
	reg_referenced_p, reg_used_between_p, no_labels_between_p,
	single_set_2, multiple_sets, set_noop_p, refers_to_regno_p,
	reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p,
	find_reg_note, find_regno_note, find_reg_equal_equiv_note,
	find_constant_src, find_reg_fusage, find_regno_fusage,
	pure_call_p, remove_note, side_effects_p, volatile_refs_p,
	volatile_insn_p, may_trap_p, may_trap_after_code_motion_p,
	may_trap_or_fault_p, inequality_comparisons_p, tablejump_p,
	computed_jump_p, auto_inc_p, in_expr_list_p,
	remove_node_from_expr_list, loc_mentioned_in_p,
	label_is_jump_target_p, reversed_comparison_code_parts,
	debug_rtx, debug_rtx_list, debug_rtx_range, debug_rtx_find,
	print_mem_expr, print_rtl, print_simple_rtl, print_rtl_single,
	print_inline_rtx): Likewise.
	* rtlanal.c (covers_regno_p, covers_regno_no_parallel_p,
	computed_jump_p_1, nonzero_bits1, rtx_unstable_p,
	rtx_addr_can_trap_p_1, rtx_addr_can_trap_p, nonzero_address_p,
	get_integer_term, get_related_value, offset_within_block_p,
	count_occurrences, reg_mentioned_p, no_labels_between_p,
	reg_used_between_p, reg_referenced_p, single_set_2,
	multiple_sets, set_noop_p, refers_to_regno_p,
	reg_overlap_mentioned_p, dead_or_set_p,
	covers_regno_no_parallel_p, covers_regno_p,
	dead_or_set_regno_p, find_reg_note, find_regno_note,
	find_reg_equal_equiv_note, find_constant_src, find_reg_fusage,
	find_regno_fusage, pure_call_p, remove_note, in_expr_list_p,
	remove_node_from_expr_list, volatile_insn_p, volatile_refs_p,
	side_effects_p, may_trap_p_1, may_trap_p,
	may_trap_after_code_motion_p, may_trap_or_fault_p,
	inequality_comparisons_p, tablejump_p, computed_jump_p_1,
	computed_jump_p, auto_inc_p, loc_mentioned_in_p, subreg_lsb,
	subreg_regno, subreg_nregs, label_is_jump_target_p): Likewise.
	* simplify-rtx.c (neg_const_int, plus_minus_operand_p,
	mode_signbit_p, simplify_replace_rtx, plus_minus_operand_p):
	Likewise.
	* toplev.h (_fatal_insn_not_found, _fatal_insn, error_for_asm,
	warning_for_asm): Likewise.
	* tree.h (print_rtl): Likewise.
	* varasm.c (get_pool_mode): Likewise.

diff -rup orig/egcc-SVN20070725/gcc/cfglayout.c egcc-SVN20070725/gcc/cfglayout.c
--- orig/egcc-SVN20070725/gcc/cfglayout.c	2007-07-17 23:02:35.000000000 -0400
+++ egcc-SVN20070725/gcc/cfglayout.c	2007-07-25 13:24:35.484989034 -0400
@@ -54,7 +54,7 @@ static void change_scope (rtx, tree, tre

 void verify_insn_chain (void);
 static void fixup_fallthru_exit_predecessor (void);
-static tree insn_scope (rtx);
+static tree insn_scope (const_rtx);

 rtx
 unlink_insn_chain (rtx first, rtx last)
@@ -451,7 +451,7 @@ change_scope (rtx orig_insn, tree s1, tr

 /* Return lexical scope block insn belong to.  */
 static tree
-insn_scope (rtx insn)
+insn_scope (const_rtx insn)
 {
   int max = VEC_length (int, block_locators_locs);
   int min = 0;
@@ -528,7 +528,7 @@ locator_line (int loc)

 /* Return line number of the statement that produced this insn.  */
 int
-insn_line (rtx insn)
+insn_line (const_rtx insn)
 {
   return locator_line (INSN_LOCATOR (insn));
 }
@@ -547,7 +547,7 @@ locator_file (int loc)

 /* Return source file of the statement that produced this insn.  */
 const char *
-insn_file (rtx insn)
+insn_file (const_rtx insn)
 {
   return locator_file (INSN_LOCATOR (insn));
 }
diff -rup orig/egcc-SVN20070725/gcc/emit-rtl.c egcc-SVN20070725/gcc/emit-rtl.c
--- orig/egcc-SVN20070725/gcc/emit-rtl.c	2007-07-25 13:42:07.276380424 -0400
+++ egcc-SVN20070725/gcc/emit-rtl.c	2007-07-25 13:24:35.492280384 -0400
@@ -195,7 +195,7 @@ int split_branch_probability = -1;
 static hashval_t
 const_int_htab_hash (const void *x)
 {
-  return (hashval_t) INTVAL ((rtx) x);
+  return (hashval_t) INTVAL ((const_rtx) x);
 }

 /* Returns nonzero if the value represented by X (which is really a
@@ -205,14 +205,14 @@ const_int_htab_hash (const void *x)
 static int
 const_int_htab_eq (const void *x, const void *y)
 {
-  return (INTVAL ((rtx) x) == *((const HOST_WIDE_INT *) y));
+  return (INTVAL ((const_rtx) x) == *((const HOST_WIDE_INT *) y));
 }

 /* Returns a hash code for X (which is really a CONST_DOUBLE).  */
 static hashval_t
 const_double_htab_hash (const void *x)
 {
-  rtx value = (rtx) x;
+  const_rtx const value = (const_rtx) x;
   hashval_t h;

   if (GET_MODE (value) == VOIDmode)
@@ -231,7 +231,7 @@ const_double_htab_hash (const void *x)
 static int
 const_double_htab_eq (const void *x, const void *y)
 {
-  rtx a = (rtx)x, b = (rtx)y;
+  const_rtx const a = (const_rtx)x, b = (const_rtx)y;

   if (GET_MODE (a) != GET_MODE (b))
     return 0;
@@ -248,7 +248,7 @@ const_double_htab_eq (const void *x, con
 static hashval_t
 mem_attrs_htab_hash (const void *x)
 {
-  mem_attrs *p = (mem_attrs *) x;
+  const mem_attrs *const p = (const mem_attrs *) x;

   return (p->alias ^ (p->align * 1000)
 	  ^ ((p->offset ? INTVAL (p->offset) : 0) * 50000)
diff -rup orig/egcc-SVN20070725/gcc/loop-iv.c egcc-SVN20070725/gcc/loop-iv.c
--- orig/egcc-SVN20070725/gcc/loop-iv.c	2007-06-20 23:02:35.000000000 -0400
+++ egcc-SVN20070725/gcc/loop-iv.c	2007-07-25 13:24:35.495485998 -0400
@@ -244,7 +244,7 @@ biv_hash (const void *b)
 static int
 biv_eq (const void *b, const void *r)
 {
-  return ((const struct biv_entry *) b)->regno == REGNO ((rtx) r);
+  return ((const struct biv_entry *) b)->regno == REGNO ((const_rtx) r);
 }

 /* Prepare the data for an induction variable analysis of a LOOP.  */
diff -rup orig/egcc-SVN20070725/gcc/print-rtl.c egcc-SVN20070725/gcc/print-rtl.c
--- orig/egcc-SVN20070725/gcc/print-rtl.c	2007-07-13 23:02:14.000000000 -0400
+++ egcc-SVN20070725/gcc/print-rtl.c	2007-07-25 13:24:35.509633156 -0400
@@ -49,7 +49,7 @@ static int sawclose = 0;

 static int indent;

-static void print_rtx (rtx);
+static void print_rtx (const_rtx);

 /* String printed at beginning of each RTL when it is dumped.
    This string is set to ASM_COMMENT_START when the RTL is dumped in
@@ -69,7 +69,7 @@ int dump_for_graph;

 #ifndef GENERATOR_FILE
 static void
-print_decl_name (FILE *outfile, tree node)
+print_decl_name (FILE *outfile, const_tree node)
 {
   if (DECL_NAME (node))
     fputs (IDENTIFIER_POINTER (DECL_NAME (node)), outfile);
@@ -86,7 +86,7 @@ print_decl_name (FILE *outfile, tree nod
 }

 void
-print_mem_expr (FILE *outfile, tree expr)
+print_mem_expr (FILE *outfile, const_tree expr)
 {
   if (TREE_CODE (expr) == COMPONENT_REF)
     {
@@ -128,7 +128,7 @@ print_mem_expr (FILE *outfile, tree expr
 /* Print IN_RTX onto OUTFILE.  This is the recursive part of printing.  */

 static void
-print_rtx (rtx in_rtx)
+print_rtx (const_rtx in_rtx)
 {
   int i = 0;
   int j;
@@ -603,7 +603,7 @@ print_rtx (rtx in_rtx)
    characters.  */

 void
-print_inline_rtx (FILE *outf, rtx x, int ind)
+print_inline_rtx (FILE *outf, const_rtx x, int ind)
 {
   int oldsaw = sawclose;
   int oldindent = indent;
@@ -619,7 +619,7 @@ print_inline_rtx (FILE *outf, rtx x, int
 /* Call this function from the debugger to see what X looks like.  */

 void
-debug_rtx (rtx x)
+debug_rtx (const_rtx x)
 {
   outfile = stderr;
   sawclose = 0;
@@ -639,10 +639,10 @@ int debug_rtx_count = 0;	/* 0 is treated
    EG: -5 prints 2 rtx's on either side (in addition to the specified rtx).  */

 void
-debug_rtx_list (rtx x, int n)
+debug_rtx_list (const_rtx x, int n)
 {
   int i,count;
-  rtx insn;
+  const_rtx insn;

   count = n == 0 ? 1 : n < 0 ? -n : n;

@@ -666,7 +666,7 @@ debug_rtx_list (rtx x, int n)
 /* Call this function to print an rtx list from START to END inclusive.  */

 void
-debug_rtx_range (rtx start, rtx end)
+debug_rtx_range (const_rtx start, const_rtx end)
 {
   while (1)
     {
@@ -682,8 +682,8 @@ debug_rtx_range (rtx start, rtx end)
    and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
    The found insn is returned to enable further debugging analysis.  */

-rtx
-debug_rtx_find (rtx x, int uid)
+const_rtx
+debug_rtx_find (const_rtx x, int uid)
 {
   while (x != 0 && INSN_UID (x) != uid)
     x = NEXT_INSN (x);
@@ -706,9 +706,9 @@ debug_rtx_find (rtx x, int uid)
    If RTX_FIRST is not an insn, then it alone is printed, with no newline.  */

 void
-print_rtl (FILE *outf, rtx rtx_first)
+print_rtl (FILE *outf, const_rtx rtx_first)
 {
-  rtx tmp_rtx;
+  const_rtx tmp_rtx;

   outfile = outf;
   sawclose = 0;
@@ -745,7 +745,7 @@ print_rtl (FILE *outf, rtx rtx_first)
 /* Return nonzero if we actually printed anything.  */

 int
-print_rtl_single (FILE *outf, rtx x)
+print_rtl_single (FILE *outf, const_rtx x)
 {
   outfile = outf;
   sawclose = 0;
@@ -764,7 +764,7 @@ print_rtl_single (FILE *outf, rtx x)
    if RTX is a CONST_INT then print in decimal format.  */

 void
-print_simple_rtl (FILE *outf, rtx x)
+print_simple_rtl (FILE *outf, const_rtx x)
 {
   flag_simple = 1;
   print_rtl (outf, x);
diff -rup orig/egcc-SVN20070725/gcc/rtl-error.c egcc-SVN20070725/gcc/rtl-error.c
--- orig/egcc-SVN20070725/gcc/rtl-error.c	2006-01-23 00:23:56.000000000 -0500
+++ egcc-SVN20070725/gcc/rtl-error.c	2007-07-25 13:24:35.510902087 -0400
@@ -33,12 +33,12 @@ Boston, MA 02110-1301, USA.  */
 #include "intl.h"
 #include "diagnostic.h"

-static location_t location_for_asm (rtx);
-static void diagnostic_for_asm (rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
+static location_t location_for_asm (const_rtx);
+static void diagnostic_for_asm (const_rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);

 /* Figure the location of the given INSN.  */
 static location_t
-location_for_asm (rtx insn)
+location_for_asm (const_rtx insn)
 {
   rtx body = PATTERN (insn);
   rtx asmop;
@@ -76,7 +76,7 @@ location_for_asm (rtx insn)
    of the insn INSN.  This is used only when INSN is an `asm' with operands,
    and each ASM_OPERANDS records its own source file and line.  */
 static void
-diagnostic_for_asm (rtx insn, const char *msg, va_list *args_ptr,
+diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr,
 		    diagnostic_t kind)
 {
   diagnostic_info diagnostic;
@@ -87,7 +87,7 @@ diagnostic_for_asm (rtx insn, const char
 }

 void
-error_for_asm (rtx insn, const char *gmsgid, ...)
+error_for_asm (const_rtx insn, const char *gmsgid, ...)
 {
   va_list ap;

@@ -97,7 +97,7 @@ error_for_asm (rtx insn, const char *gms
 }

 void
-warning_for_asm (rtx insn, const char *gmsgid, ...)
+warning_for_asm (const_rtx insn, const char *gmsgid, ...)
 {
   va_list ap;

@@ -107,7 +107,7 @@ warning_for_asm (rtx insn, const char *g
 }

 void
-_fatal_insn (const char *msgid, rtx insn, const char *file, int line,
+_fatal_insn (const char *msgid, const_rtx insn, const char *file, int line,
 	     const char *function)
 {
   error ("%s", _(msgid));
@@ -121,7 +121,7 @@ _fatal_insn (const char *msgid, rtx insn
 }

 void
-_fatal_insn_not_found (rtx insn, const char *file, int line,
+_fatal_insn_not_found (const_rtx insn, const char *file, int line,
 		       const char *function)
 {
   if (INSN_CODE (insn) < 0)
diff -rup orig/egcc-SVN20070725/gcc/rtl.c egcc-SVN20070725/gcc/rtl.c
--- orig/egcc-SVN20070725/gcc/rtl.c	2007-06-11 23:03:23.000000000 -0400
+++ egcc-SVN20070725/gcc/rtl.c	2007-07-25 13:24:35.513082986 -0400
@@ -168,7 +168,7 @@ rtvec_alloc (int n)
 /* Return the number of bytes occupied by rtx value X.  */

 unsigned int
-rtx_size (rtx x)
+rtx_size (const_rtx x)
 {
   if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_HAS_BLOCK_INFO_P (x))
     return RTX_HDR_SIZE + sizeof (struct block_symbol);
@@ -204,7 +204,7 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_D
 /* Return true if ORIG is a sharable CONST.  */

 bool
-shared_const_p (rtx orig)
+shared_const_p (const_rtx orig)
 {
   gcc_assert (GET_CODE (orig) == CONST);

@@ -319,15 +319,11 @@ copy_rtx (rtx orig)
 /* Create a new copy of an rtx.  Only copy just one level.  */

 rtx
-shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL)
+shallow_copy_rtx_stat (const_rtx orig MEM_STAT_DECL)
 {
-  unsigned int size;
-  rtx copy;
-
-  size = rtx_size (orig);
-  copy = (rtx) ggc_alloc_zone_pass_stat (size, &rtl_zone);
-  memcpy (copy, orig, size);
-  return copy;
+  const unsigned int size = rtx_size (orig);
+  rtx const copy = (rtx) ggc_alloc_zone_pass_stat (size, &rtl_zone);
+  return memcpy (copy, orig, size);
 }

 /* Nonzero when we are generating CONCATs.  */
@@ -341,7 +337,7 @@ int currently_expanding_to_rtl;
    This is the Lisp function EQUAL for rtx arguments.  */

 int
-rtx_equal_p (rtx x, rtx y)
+rtx_equal_p (const_rtx x, const_rtx y)
 {
   int i;
   int j;
@@ -480,7 +476,7 @@ dump_rtx_statistics (void)

 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
 void
-rtl_check_failed_bounds (rtx r, int n, const char *file, int line,
+rtl_check_failed_bounds (const_rtx r, int n, const char *file, int line,
 			 const char *func)
 {
   internal_error
@@ -490,7 +486,7 @@ rtl_check_failed_bounds (rtx r, int n, c
 }

 void
-rtl_check_failed_type1 (rtx r, int n, int c1, const char *file, int line,
+rtl_check_failed_type1 (const_rtx r, int n, int c1, const char *file, int line,
 			const char *func)
 {
   internal_error
@@ -500,7 +496,7 @@ rtl_check_failed_type1 (rtx r, int n, in
 }

 void
-rtl_check_failed_type2 (rtx r, int n, int c1, int c2, const char *file,
+rtl_check_failed_type2 (const_rtx r, int n, int c1, int c2, const char *file,
 			int line, const char *func)
 {
   internal_error
@@ -510,7 +506,7 @@ rtl_check_failed_type2 (rtx r, int n, in
 }

 void
-rtl_check_failed_code1 (rtx r, enum rtx_code code, const char *file,
+rtl_check_failed_code1 (const_rtx r, enum rtx_code code, const char *file,
 			int line, const char *func)
 {
   internal_error ("RTL check: expected code '%s', have '%s' in %s, at %s:%d",
@@ -519,7 +515,7 @@ rtl_check_failed_code1 (rtx r, enum rtx_
 }

 void
-rtl_check_failed_code2 (rtx r, enum rtx_code code1, enum rtx_code code2,
+rtl_check_failed_code2 (const_rtx r, enum rtx_code code1, enum rtx_code code2,
 			const char *file, int line, const char *func)
 {
   internal_error
@@ -529,7 +525,7 @@ rtl_check_failed_code2 (rtx r, enum rtx_
 }

 void
-rtl_check_failed_code_mode (rtx r, enum rtx_code code, enum machine_mode mode,
+rtl_check_failed_code_mode (const_rtx r, enum rtx_code code, enum machine_mode mode,
 			    bool not_mode, const char *file, int line,
 			    const char *func)
 {
@@ -556,7 +552,7 @@ rtl_check_failed_block_symbol (const cha

 /* XXX Maybe print the vector?  */
 void
-rtvec_check_failed_bounds (rtvec r, int n, const char *file, int line,
+rtvec_check_failed_bounds (const_rtvec r, int n, const char *file, int line,
 			   const char *func)
 {
   internal_error
@@ -567,7 +563,7 @@ rtvec_check_failed_bounds (rtvec r, int

 #if defined ENABLE_RTL_FLAG_CHECKING
 void
-rtl_check_failed_flag (const char *name, rtx r, const char *file,
+rtl_check_failed_flag (const char *name, const_rtx r, const char *file,
 		       int line, const char *func)
 {
   internal_error
diff -rup orig/egcc-SVN20070725/gcc/rtl.h egcc-SVN20070725/gcc/rtl.h
--- orig/egcc-SVN20070725/gcc/rtl.h	2007-07-25 13:41:59.640865003 -0400
+++ egcc-SVN20070725/gcc/rtl.h	2007-07-25 13:41:47.869924420 -0400
@@ -538,27 +538,27 @@ struct rtvec_def GTY(()) {
 				    __FUNCTION__);			\
    &_symbol->u.block_sym; })

-extern void rtl_check_failed_bounds (rtx, int, const char *, int,
+extern void rtl_check_failed_bounds (const_rtx, int, const char *, int,
 				     const char *)
     ATTRIBUTE_NORETURN;
-extern void rtl_check_failed_type1 (rtx, int, int, const char *, int,
+extern void rtl_check_failed_type1 (const_rtx, int, int, const char *, int,
 				    const char *)
     ATTRIBUTE_NORETURN;
-extern void rtl_check_failed_type2 (rtx, int, int, int, const char *,
+extern void rtl_check_failed_type2 (const_rtx, int, int, int, const char *,
 				    int, const char *)
     ATTRIBUTE_NORETURN;
-extern void rtl_check_failed_code1 (rtx, enum rtx_code, const char *,
+extern void rtl_check_failed_code1 (const_rtx, enum rtx_code, const char *,
 				    int, const char *)
     ATTRIBUTE_NORETURN;
-extern void rtl_check_failed_code2 (rtx, enum rtx_code, enum rtx_code,
+extern void rtl_check_failed_code2 (const_rtx, enum rtx_code, enum rtx_code,
 				    const char *, int, const char *)
     ATTRIBUTE_NORETURN;
-extern void rtl_check_failed_code_mode (rtx, enum rtx_code, enum machine_mode,
+extern void rtl_check_failed_code_mode (const_rtx, enum rtx_code, enum machine_mode,
 					bool, const char *, int, const char *)
     ATTRIBUTE_NORETURN;
 extern void rtl_check_failed_block_symbol (const char *, int, const char *)
     ATTRIBUTE_NORETURN;
-extern void rtvec_check_failed_bounds (rtvec, int, const char *, int,
+extern void rtvec_check_failed_bounds (const_rtvec, int, const char *, int,
 				       const char *)
     ATTRIBUTE_NORETURN;

@@ -655,7 +655,7 @@ extern void rtvec_check_failed_bounds (r
 			     __FUNCTION__);				\
    _rtx; })

-extern void rtl_check_failed_flag (const char *, rtx, const char *,
+extern void rtl_check_failed_flag (const char *, const_rtx, const char *,
 				   int, const char *)
     ATTRIBUTE_NORETURN
     ;
@@ -910,7 +910,7 @@ enum label_kind

 /* Retrieve the kind of LABEL.  */
 #define LABEL_KIND(LABEL) __extension__					\
-({ __typeof (LABEL) const _label = (LABEL);					\
+({ __typeof (LABEL) const _label = (LABEL);				\
    if (GET_CODE (_label) != CODE_LABEL)					\
      rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__,	\
 			    __FUNCTION__);				\
@@ -918,7 +918,7 @@ enum label_kind

 /* Set the kind of LABEL.  */
 #define SET_LABEL_KIND(LABEL, KIND) do {				\
-   rtx const _label = (LABEL);						\
+   __typeof (LABEL) const _label = (LABEL);				\
    const unsigned int _kind = (KIND);					\
    if (GET_CODE (_label) != CODE_LABEL)					\
      rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
@@ -967,7 +967,7 @@ enum label_kind

 /* Force the REGNO macro to only be used on the lhs.  */
 static inline unsigned int
-rhs_regno (rtx x)
+rhs_regno (const_rtx x)
 {
   return XCUINT (x, 0, REG);
 }
@@ -1036,15 +1036,15 @@ rhs_regno (rtx x)
 extern void init_rtlanal (void);
 extern int rtx_cost (rtx, enum rtx_code);
 extern int address_cost (rtx, enum machine_mode);
-extern unsigned int subreg_lsb (rtx);
+extern unsigned int subreg_lsb (const_rtx);
 extern unsigned int subreg_lsb_1 (enum machine_mode, enum machine_mode,
 				  unsigned int);
 extern unsigned int subreg_regno_offset	(unsigned int, enum machine_mode,
 					 unsigned int, enum machine_mode);
 extern bool subreg_offset_representable_p (unsigned int, enum machine_mode,
 					   unsigned int, enum machine_mode);
-extern unsigned int subreg_regno (rtx);
-extern unsigned int subreg_nregs (rtx);
+extern unsigned int subreg_regno (const_rtx);
+extern unsigned int subreg_nregs (const_rtx);
 extern unsigned HOST_WIDE_INT nonzero_bits (rtx, enum machine_mode);
 extern unsigned int num_sign_bit_copies (rtx, enum machine_mode);
 extern bool constant_pool_constant_p (rtx);
@@ -1466,7 +1466,7 @@ extern rtx rtx_alloc_stat (RTX_CODE MEM_
 #define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)

 extern rtvec rtvec_alloc (int);
-extern bool shared_const_p (rtx);
+extern bool shared_const_p (const_rtx);
 extern rtx copy_rtx (rtx);
 extern void dump_rtx_statistics (void);

@@ -1474,10 +1474,10 @@ extern void dump_rtx_statistics (void);
 extern rtx copy_rtx_if_shared (rtx);

 /* In rtl.c */
-extern unsigned int rtx_size (rtx);
-extern rtx shallow_copy_rtx_stat (rtx MEM_STAT_DECL);
+extern unsigned int rtx_size (const_rtx);
+extern rtx shallow_copy_rtx_stat (const_rtx MEM_STAT_DECL);
 #define shallow_copy_rtx(a) shallow_copy_rtx_stat (a MEM_STAT_INFO)
-extern int rtx_equal_p (rtx, rtx);
+extern int rtx_equal_p (const_rtx, const_rtx);

 /* In emit-rtl.c */
 extern rtvec gen_rtvec_v (int, rtx *);
@@ -1529,7 +1529,7 @@ extern rtx force_const_mem (enum machine
 struct function;
 extern rtx get_pool_constant (rtx);
 extern rtx get_pool_constant_mark (rtx, bool *);
-extern enum machine_mode get_pool_mode (rtx);
+extern enum machine_mode get_pool_mode (const_rtx);
 extern rtx simplify_subtraction (rtx);

 /* In function.c  */
@@ -1591,8 +1591,8 @@ extern rtx next_cc0_user (rtx);
 extern rtx prev_cc0_setter (rtx);

 /* In cfglayout.c  */
-extern int insn_line (rtx);
-extern const char * insn_file (rtx);
+extern int insn_line (const_rtx);
+extern const char * insn_file (const_rtx);
 extern int locator_line (int);
 extern const char * locator_file (int);
 extern int prologue_locator, epilogue_locator;
@@ -1645,10 +1645,10 @@ extern rtx simplify_subreg (enum machine
 			    unsigned int);
 extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
 				unsigned int);
-extern rtx simplify_replace_rtx (rtx, rtx, rtx);
+extern rtx simplify_replace_rtx (rtx, const_rtx, rtx);
 extern rtx simplify_rtx (rtx);
 extern rtx avoid_constant_pool_reference (rtx);
-extern bool mode_signbit_p (enum machine_mode, rtx);
+extern bool mode_signbit_p (enum machine_mode, const_rtx);

 /* In regclass.c  */
 extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
@@ -1675,69 +1675,69 @@ typedef struct replace_label_data
   bool update_label_nuses;
 } replace_label_data;

-extern int rtx_addr_can_trap_p (rtx);
-extern bool nonzero_address_p (rtx);
-extern int rtx_unstable_p (rtx);
+extern int rtx_addr_can_trap_p (const_rtx);
+extern bool nonzero_address_p (const_rtx);
+extern int rtx_unstable_p (const_rtx);
 extern int rtx_varies_p (rtx, int);
 extern int rtx_addr_varies_p (rtx, int);
-extern HOST_WIDE_INT get_integer_term (rtx);
-extern rtx get_related_value (rtx);
-extern bool offset_within_block_p (rtx, HOST_WIDE_INT);
+extern HOST_WIDE_INT get_integer_term (const_rtx);
+extern rtx get_related_value (const_rtx);
+extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT);
 extern void split_const (rtx, rtx *, rtx *);
-extern int reg_mentioned_p (rtx, rtx);
-extern int count_occurrences (rtx, rtx, int);
-extern int reg_referenced_p (rtx, rtx);
-extern int reg_used_between_p (rtx, rtx, rtx);
+extern int reg_mentioned_p (const_rtx, const_rtx);
+extern int count_occurrences (const_rtx, const_rtx, int);
+extern int reg_referenced_p (const_rtx, const_rtx);
+extern int reg_used_between_p (const_rtx, const_rtx, const_rtx);
 extern int reg_set_between_p (rtx, rtx, rtx);
 extern int commutative_operand_precedence (rtx);
 extern bool swap_commutative_operands_p (rtx, rtx);
 extern int modified_between_p (rtx, rtx, rtx);
-extern int no_labels_between_p (rtx, rtx);
+extern int no_labels_between_p (const_rtx, const_rtx);
 extern int modified_in_p (rtx, rtx);
 extern int reg_set_p (rtx, rtx);
-extern rtx single_set_2 (rtx, rtx);
-extern int multiple_sets (rtx);
-extern int set_noop_p (rtx);
+extern rtx single_set_2 (const_rtx, const_rtx);
+extern int multiple_sets (const_rtx);
+extern int set_noop_p (const_rtx);
 extern int noop_move_p (rtx);
 extern rtx find_last_value (rtx, rtx *, rtx, int);
-extern int refers_to_regno_p (unsigned int, unsigned int, rtx, rtx *);
-extern int reg_overlap_mentioned_p (rtx, rtx);
+extern int refers_to_regno_p (unsigned int, unsigned int, const_rtx, rtx *);
+extern int reg_overlap_mentioned_p (const_rtx, const_rtx);
 extern rtx set_of (rtx, rtx);
 extern void note_stores (rtx, void (*) (rtx, rtx, void *), void *);
 extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
-extern int dead_or_set_p (rtx, rtx);
-extern int dead_or_set_regno_p (rtx, unsigned int);
-extern rtx find_reg_note (rtx, enum reg_note, rtx);
-extern rtx find_regno_note (rtx, enum reg_note, unsigned int);
-extern rtx find_reg_equal_equiv_note (rtx);
-extern rtx find_constant_src (rtx);
-extern int find_reg_fusage (rtx, enum rtx_code, rtx);
-extern int find_regno_fusage (rtx, enum rtx_code, unsigned int);
-extern int pure_call_p (rtx);
-extern void remove_note (rtx, rtx);
+extern int dead_or_set_p (const_rtx, const_rtx);
+extern int dead_or_set_regno_p (const_rtx, unsigned int);
+extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx);
+extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
+extern rtx find_reg_equal_equiv_note (const_rtx);
+extern rtx find_constant_src (const_rtx);
+extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
+extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
+extern int pure_call_p (const_rtx);
+extern void remove_note (rtx, const_rtx);
 extern void remove_reg_equal_equiv_notes (rtx);
-extern int side_effects_p (rtx);
-extern int volatile_refs_p (rtx);
-extern int volatile_insn_p (rtx);
-extern int may_trap_p (rtx);
-extern int may_trap_after_code_motion_p (rtx);
-extern int may_trap_or_fault_p (rtx);
-extern int inequality_comparisons_p (rtx);
+extern int side_effects_p (const_rtx);
+extern int volatile_refs_p (const_rtx);
+extern int volatile_insn_p (const_rtx);
+extern int may_trap_p (const_rtx);
+extern int may_trap_after_code_motion_p (const_rtx);
+extern int may_trap_or_fault_p (const_rtx);
+extern int inequality_comparisons_p (const_rtx);
 extern rtx replace_rtx (rtx, rtx, rtx);
 extern int replace_label (rtx *, void *);
 extern int rtx_referenced_p (rtx, rtx);
-extern bool tablejump_p (rtx, rtx *, rtx *);
-extern int computed_jump_p (rtx);
+extern bool tablejump_p (const_rtx, rtx *, rtx *);
+extern int computed_jump_p (const_rtx);
 typedef int (*rtx_function) (rtx *, void *);
 extern int for_each_rtx (rtx *, rtx_function, void *);
 extern rtx regno_use_in (unsigned int, rtx);
-extern int auto_inc_p (rtx);
-extern int in_expr_list_p (rtx, rtx);
-extern void remove_node_from_expr_list (rtx, rtx *);
-extern int loc_mentioned_in_p (rtx *, rtx);
+extern int auto_inc_p (const_rtx);
+extern int in_expr_list_p (const_rtx, const_rtx);
+extern void remove_node_from_expr_list (const_rtx, rtx *);
+extern int loc_mentioned_in_p (rtx *, const_rtx);
 extern rtx find_first_parameter_load (rtx, rtx);
 extern bool keep_with_call_p (rtx);
-extern bool label_is_jump_target_p (rtx, rtx);
+extern bool label_is_jump_target_p (const_rtx, const_rtx);
 extern int insn_rtx_cost (rtx);

 /* Given an insn and condition, return a canonical description of
@@ -2028,8 +2028,8 @@ extern int redirect_jump (rtx, rtx, int)
 extern void rebuild_jump_labels (rtx);
 extern rtx reversed_comparison (rtx, enum machine_mode);
 extern enum rtx_code reversed_comparison_code (rtx, rtx);
-extern enum rtx_code reversed_comparison_code_parts (enum rtx_code,
-						     rtx, rtx, rtx);
+extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, rtx,
+						     rtx, rtx);
 extern void delete_for_peephole (rtx, rtx);
 extern int condjump_in_parallel_p (rtx);

@@ -2103,15 +2103,15 @@ extern void fix_sched_param (const char

 /* In print-rtl.c */
 extern const char *print_rtx_head;
-extern void debug_rtx (rtx);
-extern void debug_rtx_list (rtx, int);
-extern void debug_rtx_range (rtx, rtx);
-extern rtx debug_rtx_find (rtx, int);
-extern void print_mem_expr (FILE *, tree);
-extern void print_rtl (FILE *, rtx);
-extern void print_simple_rtl (FILE *, rtx);
-extern int print_rtl_single (FILE *, rtx);
-extern void print_inline_rtx (FILE *, rtx, int);
+extern void debug_rtx (const_rtx);
+extern void debug_rtx_list (const_rtx, int);
+extern void debug_rtx_range (const_rtx, const_rtx);
+extern const_rtx debug_rtx_find (const_rtx, int);
+extern void print_mem_expr (FILE *, const_tree);
+extern void print_rtl (FILE *, const_rtx);
+extern void print_simple_rtl (FILE *, const_rtx);
+extern int print_rtl_single (FILE *, const_rtx);
+extern void print_inline_rtx (FILE *, const_rtx, int);

 /* In function.c */
 extern void reposition_prologue_and_epilogue_notes (void);
diff -rup orig/egcc-SVN20070725/gcc/rtlanal.c egcc-SVN20070725/gcc/rtlanal.c
--- orig/egcc-SVN20070725/gcc/rtlanal.c	2007-07-23 23:03:03.000000000 -0400
+++ egcc-SVN20070725/gcc/rtlanal.c	2007-07-25 13:24:35.537769839 -0400
@@ -54,10 +54,10 @@ struct subreg_info

 /* Forward declarations */
 static void set_of_1 (rtx, rtx, void *);
-static bool covers_regno_p (rtx, unsigned int);
-static bool covers_regno_no_parallel_p (rtx, unsigned int);
+static bool covers_regno_p (const_rtx, unsigned int);
+static bool covers_regno_no_parallel_p (const_rtx, unsigned int);
 static int rtx_referenced_p_1 (rtx *, void *);
-static int computed_jump_p_1 (rtx);
+static int computed_jump_p_1 (const_rtx);
 static void parms_set (rtx, rtx, void *);
 static void subreg_get_info (unsigned int, enum machine_mode,
 			     unsigned int, enum machine_mode,
@@ -66,8 +66,8 @@ static void subreg_get_info (unsigned in
 static unsigned HOST_WIDE_INT cached_nonzero_bits (rtx, enum machine_mode,
                                                    rtx, enum machine_mode,
                                                    unsigned HOST_WIDE_INT);
-static unsigned HOST_WIDE_INT nonzero_bits1 (rtx, enum machine_mode, rtx,
-                                             enum machine_mode,
+static unsigned HOST_WIDE_INT nonzero_bits1 (rtx, enum machine_mode,
+					     rtx, enum machine_mode,
                                              unsigned HOST_WIDE_INT);
 static unsigned int cached_num_sign_bit_copies (rtx, enum machine_mode, rtx,
                                                 enum machine_mode,
@@ -107,9 +107,9 @@ num_sign_bit_copies_in_rep[MAX_MODE_INT
    (within one function) and so is anything marked `unchanging'.  */

 int
-rtx_unstable_p (rtx x)
+rtx_unstable_p (const_rtx x)
 {
-  RTX_CODE code = GET_CODE (x);
+  const RTX_CODE code = GET_CODE (x);
   int i;
   const char *fmt;

@@ -262,7 +262,7 @@ rtx_varies_p (rtx x, int for_alias)
    alignment machines.  */

 static int
-rtx_addr_can_trap_p_1 (rtx x, enum machine_mode mode, bool unaligned_mems)
+rtx_addr_can_trap_p_1 (const_rtx x, enum machine_mode mode, bool unaligned_mems)
 {
   enum rtx_code code = GET_CODE (x);

@@ -348,7 +348,7 @@ rtx_addr_can_trap_p_1 (rtx x, enum machi
 /* Return nonzero if the use of X as an address in a MEM can cause a trap.  */

 int
-rtx_addr_can_trap_p (rtx x)
+rtx_addr_can_trap_p (const_rtx x)
 {
   return rtx_addr_can_trap_p_1 (x, VOIDmode, false);
 }
@@ -356,9 +356,9 @@ rtx_addr_can_trap_p (rtx x)
 /* Return true if X is an address that is known to not be zero.  */

 bool
-nonzero_address_p (rtx x)
+nonzero_address_p (const_rtx x)
 {
-  enum rtx_code code = GET_CODE (x);
+  const enum rtx_code code = GET_CODE (x);

   switch (code)
     {
@@ -465,7 +465,7 @@ rtx_addr_varies_p (rtx x, int for_alias)
    This is used in cse.c with the `related_value' field.  */

 HOST_WIDE_INT
-get_integer_term (rtx x)
+get_integer_term (const_rtx x)
 {
   if (GET_CODE (x) == CONST)
     x = XEXP (x, 0);
@@ -484,7 +484,7 @@ get_integer_term (rtx x)
    Only obvious integer terms are detected.  */

 rtx
-get_related_value (rtx x)
+get_related_value (const_rtx x)
 {
   if (GET_CODE (x) != CONST)
     return 0;
@@ -502,7 +502,7 @@ get_related_value (rtx x)
    to somewhere in the same object or object_block as SYMBOL.  */

 bool
-offset_within_block_p (rtx symbol, HOST_WIDE_INT offset)
+offset_within_block_p (const_rtx symbol, HOST_WIDE_INT offset)
 {
   tree decl;

@@ -557,7 +557,7 @@ split_const (rtx x, rtx *base_out, rtx *
    zero, we do not count occurrences inside the destination of a SET.  */

 int
-count_occurrences (rtx x, rtx find, int count_dest)
+count_occurrences (const_rtx x, const_rtx find, int count_dest)
 {
   int i, j;
   enum rtx_code code;
@@ -627,7 +627,7 @@ count_occurrences (rtx x, rtx find, int
    for a subexpression of IN that is Lisp "equal" to REG.  */

 int
-reg_mentioned_p (rtx reg, rtx in)
+reg_mentioned_p (const_rtx reg, const_rtx in)
 {
   const char *fmt;
   int i;
@@ -692,7 +692,7 @@ reg_mentioned_p (rtx reg, rtx in)
    no CODE_LABEL insn.  */

 int
-no_labels_between_p (rtx beg, rtx end)
+no_labels_between_p (const_rtx beg, const_rtx end)
 {
   rtx p;
   if (beg == end)
@@ -707,7 +707,7 @@ no_labels_between_p (rtx beg, rtx end)
    FROM_INSN and TO_INSN (exclusive of those two).  */

 int
-reg_used_between_p (rtx reg, rtx from_insn, rtx to_insn)
+reg_used_between_p (const_rtx reg, const_rtx from_insn, const_rtx to_insn)
 {
   rtx insn;

@@ -727,7 +727,7 @@ reg_used_between_p (rtx reg, rtx from_in
    we do not consider it a reference.  */

 int
-reg_referenced_p (rtx x, rtx body)
+reg_referenced_p (const_rtx x, const_rtx body)
 {
   int i;

@@ -988,7 +988,7 @@ set_of (rtx pat, rtx insn)
    will not be used, which we ignore.  */

 rtx
-single_set_2 (rtx insn, rtx pat)
+single_set_2 (const_rtx insn, const_rtx pat)
 {
   rtx set = NULL;
   int set_verified = 1;
@@ -1041,7 +1041,7 @@ single_set_2 (rtx insn, rtx pat)
    zero.  */

 int
-multiple_sets (rtx insn)
+multiple_sets (const_rtx insn)
 {
   int found;
   int i;
@@ -1072,7 +1072,7 @@ multiple_sets (rtx insn)
    and there are no side effects.  */

 int
-set_noop_p (rtx set)
+set_noop_p (const_rtx set)
 {
   rtx src = SET_SRC (set);
   rtx dst = SET_DEST (set);
@@ -1203,7 +1203,7 @@ find_last_value (rtx x, rtx *pinsn, rtx
    LOC may be zero, meaning don't ignore anything.  */

 int
-refers_to_regno_p (unsigned int regno, unsigned int endregno, rtx x,
+refers_to_regno_p (unsigned int regno, unsigned int endregno, const_rtx x,
 		   rtx *loc)
 {
   int i;
@@ -1312,7 +1312,7 @@ refers_to_regno_p (unsigned int regno, u
    conflict because we expect this to be a rare case.  */

 int
-reg_overlap_mentioned_p (rtx x, rtx in)
+reg_overlap_mentioned_p (const_rtx x, const_rtx in)
 {
   unsigned int regno, endregno;

@@ -1550,7 +1550,7 @@ note_uses (rtx *pbody, void (*fun) (rtx
    by INSN.  */

 int
-dead_or_set_p (rtx insn, rtx x)
+dead_or_set_p (const_rtx insn, const_rtx x)
 {
   unsigned int regno, end_regno;
   unsigned int i;
@@ -1575,7 +1575,7 @@ dead_or_set_p (rtx insn, rtx x)
    part of the register is TEST_REGNO.  */

 static bool
-covers_regno_no_parallel_p (rtx dest, unsigned int test_regno)
+covers_regno_no_parallel_p (const_rtx dest, unsigned int test_regno)
 {
   unsigned int regno, endregno;

@@ -1598,7 +1598,7 @@ covers_regno_no_parallel_p (rtx dest, un
    any member matches the covers_regno_no_parallel_p criteria.  */

 static bool
-covers_regno_p (rtx dest, unsigned int test_regno)
+covers_regno_p (const_rtx dest, unsigned int test_regno)
 {
   if (GET_CODE (dest) == PARALLEL)
     {
@@ -1624,9 +1624,9 @@ covers_regno_p (rtx dest, unsigned int t
 /* Utility function for dead_or_set_p to check an individual register. */

 int
-dead_or_set_regno_p (rtx insn, unsigned int test_regno)
+dead_or_set_regno_p (const_rtx insn, unsigned int test_regno)
 {
-  rtx pattern;
+  const_rtx pattern;

   /* See if there is a death note for something that includes TEST_REGNO.  */
   if (find_regno_note (insn, REG_DEAD, test_regno))
@@ -1667,7 +1667,7 @@ dead_or_set_regno_p (rtx insn, unsigned
    If DATUM is nonzero, look for one whose datum is DATUM.  */

 rtx
-find_reg_note (rtx insn, enum reg_note kind, rtx datum)
+find_reg_note (const_rtx insn, enum reg_note kind, const_rtx datum)
 {
   rtx link;

@@ -1696,7 +1696,7 @@ find_reg_note (rtx insn, enum reg_note k
    it might be the case that the note overlaps REGNO.  */

 rtx
-find_regno_note (rtx insn, enum reg_note kind, unsigned int regno)
+find_regno_note (const_rtx insn, enum reg_note kind, unsigned int regno)
 {
   rtx link;

@@ -1719,7 +1719,7 @@ find_regno_note (rtx insn, enum reg_note
    has such a note.  */

 rtx
-find_reg_equal_equiv_note (rtx insn)
+find_reg_equal_equiv_note (const_rtx insn)
 {
   rtx link;

@@ -1748,7 +1748,7 @@ find_reg_equal_equiv_note (rtx insn)
    return null.  */

 rtx
-find_constant_src (rtx insn)
+find_constant_src (const_rtx insn)
 {
   rtx note, set, x;

@@ -1771,7 +1771,7 @@ find_constant_src (rtx insn)
    in the CALL_INSN_FUNCTION_USAGE information of INSN.  */

 int
-find_reg_fusage (rtx insn, enum rtx_code code, rtx datum)
+find_reg_fusage (const_rtx insn, enum rtx_code code, const_rtx datum)
 {
   /* If it's not a CALL_INSN, it can't possibly have a
      CALL_INSN_FUNCTION_USAGE field, so don't bother checking.  */
@@ -1816,7 +1816,7 @@ find_reg_fusage (rtx insn, enum rtx_code
    in the CALL_INSN_FUNCTION_USAGE information of INSN.  */

 int
-find_regno_fusage (rtx insn, enum rtx_code code, unsigned int regno)
+find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno)
 {
   rtx link;

@@ -1844,9 +1844,9 @@ find_regno_fusage (rtx insn, enum rtx_co
 /* Return true if INSN is a call to a pure function.  */

 int
-pure_call_p (rtx insn)
+pure_call_p (const_rtx insn)
 {
-  rtx link;
+  const_rtx link;

   if (!CALL_P (insn) || ! CONST_OR_PURE_CALL_P (insn))
     return 0;
@@ -1868,7 +1868,7 @@ pure_call_p (rtx insn)
 /* Remove register note NOTE from the REG_NOTES of INSN.  */

 void
-remove_note (rtx insn, rtx note)
+remove_note (rtx insn, const_rtx note)
 {
   rtx link;

@@ -1919,9 +1919,9 @@ remove_reg_equal_equiv_notes (rtx insn)
    NODE matches.  */

 int
-in_expr_list_p (rtx listp, rtx node)
+in_expr_list_p (const_rtx listp, const_rtx node)
 {
-  rtx x;
+  const_rtx x;

   for (x = listp; x; x = XEXP (x, 1))
     if (node == XEXP (x, 0))
@@ -1936,7 +1936,7 @@ in_expr_list_p (rtx listp, rtx node)
    A simple equality test is used to determine if NODE matches.  */

 void
-remove_node_from_expr_list (rtx node, rtx *listp)
+remove_node_from_expr_list (const_rtx node, rtx *listp)
 {
   rtx temp = *listp;
   rtx prev = NULL_RTX;
@@ -1965,11 +1965,9 @@ remove_node_from_expr_list (rtx node, rt
    only volatile asms and UNSPEC_VOLATILE instructions.  */

 int
-volatile_insn_p (rtx x)
+volatile_insn_p (const_rtx x)
 {
-  RTX_CODE code;
-
-  code = GET_CODE (x);
+  const RTX_CODE code = GET_CODE (x);
   switch (code)
     {
     case LABEL_REF:
@@ -2005,7 +2003,7 @@ volatile_insn_p (rtx x)
   /* Recursively scan the operands of this expression.  */

   {
-    const char *fmt = GET_RTX_FORMAT (code);
+    const char *const fmt = GET_RTX_FORMAT (code);
     int i;

     for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
@@ -2031,11 +2029,9 @@ volatile_insn_p (rtx x)
    UNSPEC_VOLATILE operations or volatile ASM_OPERANDS expressions.  */

 int
-volatile_refs_p (rtx x)
+volatile_refs_p (const_rtx x)
 {
-  RTX_CODE code;
-
-  code = GET_CODE (x);
+  const RTX_CODE code = GET_CODE (x);
   switch (code)
     {
     case LABEL_REF:
@@ -2069,7 +2065,7 @@ volatile_refs_p (rtx x)
   /* Recursively scan the operands of this expression.  */

   {
-    const char *fmt = GET_RTX_FORMAT (code);
+    const char *const fmt = GET_RTX_FORMAT (code);
     int i;

     for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
@@ -2095,11 +2091,9 @@ volatile_refs_p (rtx x)
    incrementing.  */

 int
-side_effects_p (rtx x)
+side_effects_p (const_rtx x)
 {
-  RTX_CODE code;
-
-  code = GET_CODE (x);
+  const RTX_CODE code = GET_CODE (x);
   switch (code)
     {
     case LABEL_REF:
@@ -2181,7 +2175,7 @@ enum may_trap_p_flags
    elsewhere.  */

 static int
-may_trap_p_1 (rtx x, unsigned flags)
+may_trap_p_1 (const_rtx x, unsigned flags)
 {
   int i;
   enum rtx_code code;
@@ -2317,7 +2311,7 @@ may_trap_p_1 (rtx x, unsigned flags)
 /* Return nonzero if evaluating rtx X might cause a trap.  */

 int
-may_trap_p (rtx x)
+may_trap_p (const_rtx x)
 {
   return may_trap_p_1 (x, 0);
 }
@@ -2326,7 +2320,7 @@ may_trap_p (rtx x)
    is moved from its current location by some optimization.  */

 int
-may_trap_after_code_motion_p (rtx x)
+may_trap_after_code_motion_p (const_rtx x)
 {
   return may_trap_p_1 (x, MTP_AFTER_MOVE);
 }
@@ -2372,7 +2366,7 @@ may_trap_after_code_motion_p (rtx x)
    on a strict alignment machine.  */

 int
-may_trap_or_fault_p (rtx x)
+may_trap_or_fault_p (const_rtx x)
 {
   return may_trap_p_1 (x, MTP_UNALIGNED_MEMS);
 }
@@ -2381,11 +2375,11 @@ may_trap_or_fault_p (rtx x)
    i.e., an inequality.  */

 int
-inequality_comparisons_p (rtx x)
+inequality_comparisons_p (const_rtx x)
 {
   const char *fmt;
   int len, i;
-  enum rtx_code code = GET_CODE (x);
+  const enum rtx_code code = GET_CODE (x);

   switch (code)
     {
@@ -2604,7 +2598,7 @@ rtx_referenced_p (rtx x, rtx body)
    *LABELP and the jump table to *TABLEP.  LABELP and TABLEP may be NULL.  */

 bool
-tablejump_p (rtx insn, rtx *labelp, rtx *tablep)
+tablejump_p (const_rtx insn, rtx *labelp, rtx *tablep)
 {
   rtx label, table;

@@ -2629,9 +2623,9 @@ tablejump_p (rtx insn, rtx *labelp, rtx
    of an IF_THEN_ELSE.  */

 static int
-computed_jump_p_1 (rtx x)
+computed_jump_p_1 (const_rtx x)
 {
-  enum rtx_code code = GET_CODE (x);
+  const enum rtx_code code = GET_CODE (x);
   int i, j;
   const char *fmt;

@@ -2683,7 +2677,7 @@ computed_jump_p_1 (rtx x)
    we can recognize them by a (use (label_ref)).  */

 int
-computed_jump_p (rtx insn)
+computed_jump_p (const_rtx insn)
 {
   int i;
   if (JUMP_P (insn))
@@ -2941,7 +2935,7 @@ swap_commutative_operands_p (rtx x, rtx
 /* Return 1 if X is an autoincrement side effect and the register is
    not the stack pointer.  */
 int
-auto_inc_p (rtx x)
+auto_inc_p (const_rtx x)
 {
   switch (GET_CODE (x))
     {
@@ -2962,7 +2956,7 @@ auto_inc_p (rtx x)

 /* Return nonzero if IN contains a piece of rtl that has the address LOC.  */
 int
-loc_mentioned_in_p (rtx *loc, rtx in)
+loc_mentioned_in_p (rtx *loc, const_rtx in)
 {
   enum rtx_code code;
   const char *fmt;
@@ -3036,7 +3030,7 @@ subreg_lsb_1 (enum machine_mode outer_mo
    (counting from the least significant bit of the reg).  */

 unsigned int
-subreg_lsb (rtx x)
+subreg_lsb (const_rtx x)
 {
   return subreg_lsb_1 (GET_MODE (x), GET_MODE (SUBREG_REG (x)),
 		       SUBREG_BYTE (x));
@@ -3233,7 +3227,7 @@ subreg_offset_representable_p (unsigned

 /* Return the final regno that a subreg expression refers to.  */
 unsigned int
-subreg_regno (rtx x)
+subreg_regno (const_rtx x)
 {
   unsigned int ret;
   rtx subreg = SUBREG_REG (x);
@@ -3250,7 +3244,7 @@ subreg_regno (rtx x)
 /* Return the number of registers that a subreg expression refers
    to.  */
 unsigned int
-subreg_nregs (rtx x)
+subreg_nregs (const_rtx x)
 {
   struct subreg_info info;
   rtx subreg = SUBREG_REG (x);
@@ -3389,7 +3383,7 @@ keep_with_call_p (rtx insn)
    not apply to the fallthru case of a conditional jump.  */

 bool
-label_is_jump_target_p (rtx label, rtx jump_insn)
+label_is_jump_target_p (const_rtx label, const_rtx jump_insn)
 {
   rtx tmp = JUMP_LABEL (jump_insn);

@@ -4541,7 +4535,7 @@ canonicalize_condition (rtx insn, rtx co
 {
   enum rtx_code code;
   rtx prev = insn;
-  rtx set;
+  const_rtx set;
   rtx tem;
   rtx op0, op1;
   int reverse_code = 0;
diff -rup orig/egcc-SVN20070725/gcc/simplify-rtx.c egcc-SVN20070725/gcc/simplify-rtx.c
--- orig/egcc-SVN20070725/gcc/simplify-rtx.c	2007-07-23 23:03:06.000000000 -0400
+++ egcc-SVN20070725/gcc/simplify-rtx.c	2007-07-25 13:37:29.533420021 -0400
@@ -50,8 +50,8 @@ Software Foundation, 51 Franklin Street,
 #define HWI_SIGN_EXTEND(low) \
  ((((HOST_WIDE_INT) low) < 0) ? ((HOST_WIDE_INT) -1) : ((HOST_WIDE_INT) 0))

-static rtx neg_const_int (enum machine_mode, rtx);
-static bool plus_minus_operand_p (rtx);
+static rtx neg_const_int (enum machine_mode, const_rtx);
+static bool plus_minus_operand_p (const_rtx);
 static bool simplify_plus_minus_op_data_cmp (rtx, rtx);
 static rtx simplify_plus_minus (enum rtx_code, enum machine_mode, rtx, rtx);
 static rtx simplify_immed_subreg (enum machine_mode, rtx, enum machine_mode,
@@ -67,7 +67,7 @@ static rtx simplify_binary_operation_1 (
 /* Negate a CONST_INT rtx, truncating (because a conversion from a
    maximally negative number can overflow).  */
 static rtx
-neg_const_int (enum machine_mode mode, rtx i)
+neg_const_int (enum machine_mode mode, const_rtx i)
 {
   return gen_int_mode (- INTVAL (i), mode);
 }
@@ -76,7 +76,7 @@ neg_const_int (enum machine_mode mode, r
    the most significant bit of machine mode MODE.  */

 bool
-mode_signbit_p (enum machine_mode mode, rtx x)
+mode_signbit_p (enum machine_mode mode, const_rtx x)
 {
   unsigned HOST_WIDE_INT val;
   unsigned int width;
@@ -255,7 +255,7 @@ simplify_gen_relational (enum rtx_code c
    resulting RTX.  Return a new RTX which is as simplified as possible.  */

 rtx
-simplify_replace_rtx (rtx x, rtx old_rtx, rtx new_rtx)
+simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
 {
   enum rtx_code code = GET_CODE (x);
   enum machine_mode mode = GET_MODE (x);
@@ -3601,7 +3601,7 @@ simplify_plus_minus (enum rtx_code code,

 /* Check whether an operand is suitable for calling simplify_plus_minus.  */
 static bool
-plus_minus_operand_p (rtx x)
+plus_minus_operand_p (const_rtx x)
 {
   return GET_CODE (x) == PLUS
          || GET_CODE (x) == MINUS
diff -rup orig/egcc-SVN20070725/gcc/toplev.h egcc-SVN20070725/gcc/toplev.h
--- orig/egcc-SVN20070725/gcc/toplev.h	2007-03-14 20:03:10.000000000 -0500
+++ egcc-SVN20070725/gcc/toplev.h	2007-07-25 13:24:35.559372865 -0400
@@ -31,9 +31,9 @@ extern int toplev_main (unsigned int, co
 extern int read_integral_parameter (const char *, const char *, const int);
 extern void strip_off_ending (char *, int);
 extern const char *trim_filename (const char *);
-extern void _fatal_insn_not_found (rtx, const char *, int, const char *)
+extern void _fatal_insn_not_found (const_rtx, const char *, int, const char *)
      ATTRIBUTE_NORETURN;
-extern void _fatal_insn (const char *, rtx, const char *, int, const char *)
+extern void _fatal_insn (const char *, const_rtx, const char *, int, const char *)
      ATTRIBUTE_NORETURN;

 #define fatal_insn(msgid, insn) \
@@ -76,8 +76,8 @@ extern bool enable_rtl_dump_file (int);

 extern void announce_function (tree);

-extern void error_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void warning_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void error_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warning_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void warn_deprecated_use (tree);

 #ifdef BUFSIZ
diff -rup orig/egcc-SVN20070725/gcc/tree.h egcc-SVN20070725/gcc/tree.h
--- orig/egcc-SVN20070725/gcc/tree.h	2007-07-25 13:42:07.400945824 -0400
+++ egcc-SVN20070725/gcc/tree.h	2007-07-25 13:24:35.565565723 -0400
@@ -4647,7 +4647,7 @@ extern tree gimplify_parameters (void);

 /* In print-rtl.c */
 #ifdef BUFSIZ
-extern void print_rtl (FILE *, rtx);
+extern void print_rtl (FILE *, const_rtx);
 #endif

 /* In print-tree.c */
diff -rup orig/egcc-SVN20070725/gcc/varasm.c egcc-SVN20070725/gcc/varasm.c
--- orig/egcc-SVN20070725/gcc/varasm.c	2007-07-25 13:42:07.411052377 -0400
+++ egcc-SVN20070725/gcc/varasm.c	2007-07-25 13:24:35.571672481 -0400
@@ -3603,7 +3603,7 @@ get_pool_constant_mark (rtx addr, bool *
 /* Similar, return the mode.  */

 enum machine_mode
-get_pool_mode (rtx addr)
+get_pool_mode (const_rtx addr)
 {
   return SYMBOL_REF_CONSTANT (addr)->mode;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-25 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 18:42 [PATCH INSTALLED]: const typedefs part 3/N Kaveh R. GHAZI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).