This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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 INSTALLED]: const typedefs part 18/N


Another constification patch.  This one does a couple more langhooks
and a bunch of C/C++ frontend predicates.  Also a few random
stragglers in the middle-end.

I'm copying the fortran and java-patches lists since this patch
touches those frontends for the hooks.

Bootstrapped on sparc-sun-solaris2.10, no regressions.

Installed on mainline.

		--Kaveh


2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* c-common.c (vector_types_convertible_p,
	decl_with_nonnull_addr_p, c_promoting_integer_type_p,
	self_promoting_args_p): Constify.
	* c-common.h (has_c_linkage, decl_with_nonnull_addr_p,
	c_promoting_integer_type_p, self_promoting_args_p,
	anon_aggr_type_p, vector_types_convertible_p): Likewise.
	* c-decl.c (anon_aggr_type_p): Likewise.
	* * c-dump.c (dump_stmt): Likewise.
	* c-objc-common.c (has_c_linkage): Likewise.
	* c-tree.h (same_translation_unit_p): Likewise.
	* c-typeck.c (null_pointer_constant_p,
	tagged_types_tu_compatible_p, function_types_compatible_p,
	type_lists_compatible_p, lvalue_or_else, lvalue_p,
	comptypes_internal, struct tagged_tu_seen_cache,
	same_translation_unit_p, alloc_tagged_tu_seen_cache,
	c_size_in_bytes): Likewise.
	* ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor,
	hash_ptr, eq_ptr): Likewise.
	* langhooks-def.h (lhd_decl_ok_for_sibcall,
	LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise.
	* langhooks.c (lhd_decl_ok_for_sibcall): Likewise.
	* langhooks.h (ok_for_sibcall, omp_privatize_by_reference):
	Likewise.
	* optabs.c (optab_for_tree_code): Likewise.
	* optabs.h (optab_for_tree_code): Likewise.
	* rtl.h (simplify_rtx): Likewise.
	* simplify-rtx.c (simplify_rtx): Likewise.
	* tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type,
	dump_flag, dump_node): Likewise.
	* tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index,
	queue_and_dump_type, dump_flag): Likewise.
	* tree-flow.h (vect_can_force_dr_alignment_p): Likewise.
	* tree-pass.h (dump_node): Likewise.
	* tree-vectorizer.c (vect_can_force_dr_alignment_p,
	supportable_narrowing_operation): Likewise.
	* tree-vectorizer.h (vect_can_force_dr_alignment_p,
	supportable_narrowing_operation): Likewise.
	* tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity,
	is_negative_overflow_infinity, is_positive_overflow_infinity,
	is_overflow_infinity, vrp_val_is_max, vrp_val_is_min,
	nonnull_arg_p, get_value_range, vrp_operand_equal_p,
	update_value_range, add_equivalence, ssa_name_nonnegative_p,
	ssa_name_nonzero_p, fp_predicate): Likewise.
	* tree.c (auto_var_in_fn_p, empty_body_p): Likewise.
	* tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p,
	ssa_name_nonnegative_p): Likewise.

cp:
	* call.c (sufficient_parms_p): Constify.
	* class.c (same_signature_p): Likewise.
	* cp-gimplify.c (is_invisiref_parm,
	cxx_omp_privatize_by_reference): Likewise.
	* cp-objcp-common.c (has_c_linkage): Likewise.
	* cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
	sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
	grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
	num_artificial_parms_for, comp_template_parms,
	template_parameter_pack_p, any_dependent_template_arguments_p,
	any_type_dependent_arguments_p, any_value_dependent_elements_p,
	repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
	zero_init_p, member_p, cp_lvalue_kind,
	builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
	varargs_function_p, is_dummy_object, special_function_kind,
	string_conv_p, type_unknown_p, comp_except_specs, compparms,
	comp_cv_qualification, is_bitfield_expr_with_lowered_type,
	unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
	cp_has_mutable_p, at_least_as_qualified_p,
	invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
	* decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
	* except.c (nothrow_libfn_p): Likewise.
	* method.c (skip_artificial_parms_for, num_artificial_parms_for):
	Likewise.
	* pt.c (comp_template_parms, template_parameter_pack_p,
	any_type_dependent_arguments_p, any_value_dependent_elements_p,
	any_dependent_template_arguments_p): Likewise.
	* repo.c (repo_export_class_p): Likewise.
	* semantics.c (anon_aggr_type_p): Likewise.
	* tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
	builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
	varargs_function_p, member_p, is_dummy_object, pod_type_p,
	zero_init_p, special_function_p): Likewise.
	* typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
	comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
	compparms, invalid_nonstatic_memfn_p,
	is_bitfield_expr_with_lowered_type, unlowered_expr_type,
	string_conv_p, ptr_reasonably_similar, cp_type_readonly,
	cp_has_mutable_p, lvalue_or_else): Likewise.

fortran:
	* trans-openmp.c (gfc_omp_privatize_by_reference): Constify.
	* trans.h (gfc_omp_privatize_by_reference): Likewise.

java:
	* lang.c (java_decl_ok_for_sibcall): Likewise.

diff -rup orig/egcc-SVN20070824/gcc/c-common.c egcc-SVN20070824/gcc/c-common.c
--- orig/egcc-SVN20070824/gcc/c-common.c	2007-08-20 20:03:33.000000000 -0400
+++ egcc-SVN20070824/gcc/c-common.c	2007-08-24 23:49:07.098564817 -0400
@@ -1172,7 +1172,7 @@ check_main_parameter_types (tree decl)
    in effect, emit a note telling the user about that option if such
    a note has not previously been emitted.  */
 bool
-vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note)
+vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note)
 {
   static bool emitted_lax_note = false;
   bool convertible_lax;
@@ -2896,7 +2896,7 @@ pointer_int_sum (enum tree_code resultco
    NULL.  */

 bool
-decl_with_nonnull_addr_p (tree expr)
+decl_with_nonnull_addr_p (const_tree expr)
 {
   return (DECL_P (expr)
 	  && (TREE_CODE (expr) == PARM_DECL
@@ -4097,7 +4097,7 @@ def_builtin_1 (enum built_in_function fn
    integral promotions defined in ISO C99 6.3.1.1/2.  */

 bool
-c_promoting_integer_type_p (tree t)
+c_promoting_integer_type_p (const_tree t)
 {
   switch (TREE_CODE (t))
     {
@@ -4127,9 +4127,9 @@ c_promoting_integer_type_p (tree t)
    and none of their types is affected by default promotions.  */

 int
-self_promoting_args_p (tree parms)
+self_promoting_args_p (const_tree parms)
 {
-  tree t;
+  const_tree t;
   for (t = parms; t; t = TREE_CHAIN (t))
     {
       tree type = TREE_VALUE (t);
diff -rup orig/egcc-SVN20070824/gcc/c-common.h egcc-SVN20070824/gcc/c-common.h
--- orig/egcc-SVN20070824/gcc/c-common.h	2007-08-20 20:03:33.000000000 -0400
+++ egcc-SVN20070824/gcc/c-common.h	2007-08-24 23:49:07.101526455 -0400
@@ -319,7 +319,7 @@ extern int c_expand_decl (tree);
 extern int field_decl_cmp (const void *, const void *);
 extern void resort_sorted_fields (void *, void *, gt_pointer_operator,
 				  void *);
-extern bool has_c_linkage (tree decl);
+extern bool has_c_linkage (const_tree decl);

 /* Switches common to the C front ends.  */

@@ -677,7 +677,7 @@ extern tree c_common_unsigned_type (tree
 extern tree c_common_signed_type (tree);
 extern tree c_common_signed_or_unsigned_type (int, tree);
 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
-extern bool decl_with_nonnull_addr_p (tree);
+extern bool decl_with_nonnull_addr_p (const_tree);
 extern tree c_common_truthvalue_conversion (tree);
 extern void c_apply_type_quals_to_decl (int, tree);
 extern tree c_sizeof_or_alignof_type (tree, bool, int);
@@ -731,8 +731,8 @@ extern void c_common_finish (void);
 extern void c_common_parse_file (int);
 extern alias_set_type c_common_get_alias_set (tree);
 extern void c_register_builtin_type (tree, const char*);
-extern bool c_promoting_integer_type_p (tree);
-extern int self_promoting_args_p (tree);
+extern bool c_promoting_integer_type_p (const_tree);
+extern int self_promoting_args_p (const_tree);
 extern tree strip_array_types (tree);
 extern const_tree const_strip_array_types (const_tree);
 extern tree strip_pointer_operator (tree);
@@ -772,7 +772,7 @@ enum c_tree_code {

 #undef DEFTREECODE

-extern int anon_aggr_type_p (tree);
+extern int anon_aggr_type_p (const_tree);

 /* For a VAR_DECL that is an anonymous union, these are the various
    sub-variables that make up the anonymous union.  */
@@ -830,7 +830,7 @@ extern tree finish_label_address_expr (t
 extern tree lookup_label (tree);
 extern tree lookup_name (tree);

-extern bool vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note);
+extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note);

 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
 extern void c_expand_body (tree);
diff -rup orig/egcc-SVN20070824/gcc/c-decl.c egcc-SVN20070824/gcc/c-decl.c
--- orig/egcc-SVN20070824/gcc/c-decl.c	2007-08-24 20:02:19.000000000 -0400
+++ egcc-SVN20070824/gcc/c-decl.c	2007-08-24 23:49:07.109926859 -0400
@@ -6973,7 +6973,7 @@ current_stmt_tree (void)
    C.  */

 int
-anon_aggr_type_p (tree ARG_UNUSED (node))
+anon_aggr_type_p (const_tree ARG_UNUSED (node))
 {
   return 0;
 }
diff -rup orig/egcc-SVN20070824/gcc/c-dump.c egcc-SVN20070824/gcc/c-dump.c
--- orig/egcc-SVN20070824/gcc/c-dump.c	2007-07-26 23:04:03.000000000 -0400
+++ egcc-SVN20070824/gcc/c-dump.c	2007-08-24 23:49:07.111042474 -0400
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3.
 /* Dump information common to statements from STMT.  */

 void
-dump_stmt (dump_info_p di, tree t)
+dump_stmt (dump_info_p di, const_tree t)
 {
   if (EXPR_HAS_LOCATION (t))
     dump_int (di, "line", EXPR_LINENO (t));
diff -rup orig/egcc-SVN20070824/gcc/c-objc-common.c egcc-SVN20070824/gcc/c-objc-common.c
--- orig/egcc-SVN20070824/gcc/c-objc-common.c	2007-08-24 15:16:09.000000000 -0400
+++ egcc-SVN20070824/gcc/c-objc-common.c	2007-08-24 23:49:07.111800808 -0400
@@ -166,7 +166,7 @@ c_tree_printer (pretty_printer *pp, text

 /* In C and ObjC, all decls have "C" linkage.  */
 bool
-has_c_linkage (tree decl ATTRIBUTE_UNUSED)
+has_c_linkage (const_tree decl ATTRIBUTE_UNUSED)
 {
   return true;
 }
diff -rup orig/egcc-SVN20070824/gcc/c-tree.h egcc-SVN20070824/gcc/c-tree.h
--- orig/egcc-SVN20070824/gcc/c-tree.h	2007-08-20 20:03:31.000000000 -0400
+++ egcc-SVN20070824/gcc/c-tree.h	2007-08-24 23:49:07.113018847 -0400
@@ -543,7 +543,7 @@ extern struct c_label_context_se *label_
 extern struct c_label_context_vm *label_context_stack_vm;

 extern tree require_complete_type (tree);
-extern int same_translation_unit_p (tree, tree);
+extern int same_translation_unit_p (const_tree, const_tree);
 extern int comptypes (tree, tree);
 extern bool c_vla_type_p (const_tree);
 extern bool c_mark_addressable (tree);
diff -rup orig/egcc-SVN20070824/gcc/c-typeck.c egcc-SVN20070824/gcc/c-typeck.c
--- orig/egcc-SVN20070824/gcc/c-typeck.c	2007-08-20 20:03:32.000000000 -0400
+++ egcc-SVN20070824/gcc/c-typeck.c	2007-08-24 23:49:07.125711032 -0400
@@ -74,12 +74,12 @@ static int missing_braces_mentioned;
 static int require_constant_value;
 static int require_constant_elements;

-static bool null_pointer_constant_p (tree);
+static bool null_pointer_constant_p (const_tree);
 static tree qualify_type (tree, tree);
-static int tagged_types_tu_compatible_p (tree, tree);
+static int tagged_types_tu_compatible_p (const_tree, const_tree);
 static int comp_target_types (tree, tree);
-static int function_types_compatible_p (tree, tree);
-static int type_lists_compatible_p (tree, tree);
+static int function_types_compatible_p (const_tree, const_tree);
+static int type_lists_compatible_p (const_tree, const_tree);
 static tree decl_constant_value_for_broken_optimization (tree);
 static tree lookup_field (tree, tree);
 static int convert_arguments (int, tree *, tree, tree, tree, tree);
@@ -102,15 +102,15 @@ static void set_nonincremental_init (voi
 static void set_nonincremental_init_from_string (tree);
 static tree find_init_member (tree);
 static void readonly_error (tree, enum lvalue_use);
-static int lvalue_or_else (tree, enum lvalue_use);
-static int lvalue_p (tree);
+static int lvalue_or_else (const_tree, enum lvalue_use);
+static int lvalue_p (const_tree);
 static void record_maybe_used_decl (tree);
-static int comptypes_internal (tree, tree);
+static int comptypes_internal (const_tree, const_tree);

 /* Return true if EXP is a null pointer constant, false otherwise.  */

 static bool
-null_pointer_constant_p (tree expr)
+null_pointer_constant_p (const_tree expr)
 {
   /* This should really operate on c_expr structures, but they aren't
      yet available everywhere required.  */
@@ -127,8 +127,8 @@ null_pointer_constant_p (tree expr)

 struct tagged_tu_seen_cache {
   const struct tagged_tu_seen_cache * next;
-  tree t1;
-  tree t2;
+  const_tree t1;
+  const_tree t2;
   /* The return value of tagged_types_tu_compatible_p if we had seen
      these two types already.  */
   int val;
@@ -869,10 +869,10 @@ comptypes (tree type1, tree type2)
    differs from comptypes, in that we don't free the seen types.  */

 static int
-comptypes_internal (tree type1, tree type2)
+comptypes_internal (const_tree type1, const_tree type2)
 {
-  tree t1 = type1;
-  tree t2 = type2;
+  const_tree t1 = type1;
+  const_tree t2 = type2;
   int attrval, val;

   /* Suppress errors caused by previously reported errors.  */
@@ -1045,7 +1045,7 @@ comp_target_types (tree ttl, tree ttr)
    being parsed, so if two trees have context chains ending in null,
    they're in the same translation unit.  */
 int
-same_translation_unit_p (tree t1, tree t2)
+same_translation_unit_p (const_tree t1, const_tree t2)
 {
   while (t1 && TREE_CODE (t1) != TRANSLATION_UNIT_DECL)
     switch (TREE_CODE_CLASS (TREE_CODE (t1)))
@@ -1077,7 +1077,7 @@ same_translation_unit_p (tree t1, tree t
 /* Allocate the seen two types, assuming that they are compatible. */

 static struct tagged_tu_seen_cache *
-alloc_tagged_tu_seen_cache (tree t1, tree t2)
+alloc_tagged_tu_seen_cache (const_tree t1, const_tree t2)
 {
   struct tagged_tu_seen_cache *tu = XNEW (struct tagged_tu_seen_cache);
   tu->next = tagged_tu_seen_base;
@@ -1125,7 +1125,7 @@ free_all_tagged_tu_seen_up_to (const str
    rules.  */

 static int
-tagged_types_tu_compatible_p (tree t1, tree t2)
+tagged_types_tu_compatible_p (const_tree t1, const_tree t2)
 {
   tree s1, s2;
   bool needs_warning = false;
@@ -1339,7 +1339,7 @@ tagged_types_tu_compatible_p (tree t1, t
    Otherwise, the argument types must match.  */

 static int
-function_types_compatible_p (tree f1, tree f2)
+function_types_compatible_p (const_tree f1, const_tree f2)
 {
   tree args1, args2;
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
@@ -1402,7 +1402,7 @@ function_types_compatible_p (tree f1, tr
    or 2 for compatible with warning.  */

 static int
-type_lists_compatible_p (tree args1, tree args2)
+type_lists_compatible_p (const_tree args1, const_tree args2)
 {
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
   int val = 1;
@@ -1503,7 +1503,7 @@ type_lists_compatible_p (tree args1, tre
 /* Compute the size to increment a pointer by.  */

 static tree
-c_size_in_bytes (tree type)
+c_size_in_bytes (const_tree type)
 {
   enum tree_code code = TREE_CODE (type);

@@ -3198,9 +3198,9 @@ build_unary_op (enum tree_code code, tre
    Lvalues can have their address taken, unless they have C_DECL_REGISTER.  */

 static int
-lvalue_p (tree ref)
+lvalue_p (const_tree ref)
 {
-  enum tree_code code = TREE_CODE (ref);
+  const enum tree_code code = TREE_CODE (ref);

   switch (code)
     {
@@ -3274,7 +3274,7 @@ readonly_error (tree arg, enum lvalue_us
    how the lvalue is being used and so selects the error message.  */

 static int
-lvalue_or_else (tree ref, enum lvalue_use use)
+lvalue_or_else (const_tree ref, enum lvalue_use use)
 {
   int win = lvalue_p (ref);

diff -rup orig/egcc-SVN20070824/gcc/cp/call.c egcc-SVN20070824/gcc/cp/call.c
--- orig/egcc-SVN20070824/gcc/cp/call.c	2007-08-20 20:03:16.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/call.c	2007-08-24 23:49:07.132820900 -0400
@@ -467,7 +467,7 @@ null_ptr_cst_p (tree t)
    ellipsis.  */

 bool
-sufficient_parms_p (tree parmlist)
+sufficient_parms_p (const_tree parmlist)
 {
   for (; parmlist && parmlist != void_list_node;
        parmlist = TREE_CHAIN (parmlist))
diff -rup orig/egcc-SVN20070824/gcc/cp/class.c egcc-SVN20070824/gcc/cp/class.c
--- orig/egcc-SVN20070824/gcc/cp/class.c	2007-08-20 20:03:14.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/class.c	2007-08-24 23:49:07.140479454 -0400
@@ -1774,7 +1774,7 @@ layout_vtable_decl (tree binfo, int n)
    have the same signature.  */

 int
-same_signature_p (tree fndecl, tree base_fndecl)
+same_signature_p (const_tree fndecl, const_tree base_fndecl)
 {
   /* One destructor overrides another if they are the same kind of
      destructor.  */
diff -rup orig/egcc-SVN20070824/gcc/cp/cp-gimplify.c egcc-SVN20070824/gcc/cp/cp-gimplify.c
--- orig/egcc-SVN20070824/gcc/cp/cp-gimplify.c	2007-08-20 20:03:21.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/cp-gimplify.c	2007-08-24 23:49:07.142374448 -0400
@@ -590,7 +590,7 @@ cp_gimplify_expr (tree *expr_p, tree *pr
 }

 static inline bool
-is_invisiref_parm (tree t)
+is_invisiref_parm (const_tree t)
 {
   return ((TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL)
 	  && DECL_BY_REFERENCE (t));
@@ -928,7 +928,7 @@ cxx_omp_clause_dtor (tree clause, tree d
    than the DECL itself.  */

 bool
-cxx_omp_privatize_by_reference (tree decl)
+cxx_omp_privatize_by_reference (const_tree decl)
 {
   return is_invisiref_parm (decl);
 }
diff -rup orig/egcc-SVN20070824/gcc/cp/cp-objcp-common.c egcc-SVN20070824/gcc/cp/cp-objcp-common.c
--- orig/egcc-SVN20070824/gcc/cp/cp-objcp-common.c	2007-08-20 20:03:16.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/cp-objcp-common.c	2007-08-24 23:49:07.143233285 -0400
@@ -229,7 +229,7 @@ pop_file_scope (void)

 /* c-pragma.c needs to query whether a decl has extern "C" linkage.  */
 bool
-has_c_linkage (tree decl)
+has_c_linkage (const_tree decl)
 {
   return DECL_EXTERN_C_P (decl);
 }
diff -rup orig/egcc-SVN20070824/gcc/cp/cp-tree.h egcc-SVN20070824/gcc/cp/cp-tree.h
--- orig/egcc-SVN20070824/gcc/cp/cp-tree.h	2007-08-24 15:15:35.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/cp-tree.h	2007-08-25 01:40:07.693643645 -0400
@@ -182,14 +182,14 @@ struct diagnostic_context;

 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
 #define NON_THUNK_FUNCTION_CHECK(NODE) __extension__			\
-({  const tree __t = (NODE);						\
+({  __typeof(NODE) const __t = (NODE);					\
     if (TREE_CODE (__t) != FUNCTION_DECL &&				\
 	TREE_CODE (__t) != TEMPLATE_DECL && __t->decl_common.lang_specific	\
 	&& __t->decl_common.lang_specific->decl_flags.thunk_p)			\
       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0);	\
     __t; })
 #define THUNK_FUNCTION_CHECK(NODE) __extension__			\
-({  const tree __t = (NODE);						\
+({  __typeof (NODE) const __t = (NODE);					\
     if (TREE_CODE (__t) != FUNCTION_DECL || !__t->decl_common.lang_specific	\
 	|| !__t->decl_common.lang_specific->decl_flags.thunk_p)		\
       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0);	\
@@ -4069,7 +4069,7 @@ extern tree build_addr_func			(tree);
 extern tree build_call_a			(tree, int, tree*);
 extern tree build_call_n			(tree, int, ...);
 extern bool null_ptr_cst_p			(tree);
-extern bool sufficient_parms_p			(tree);
+extern bool sufficient_parms_p			(const_tree);
 extern tree type_decays_to			(tree);
 extern tree build_user_type_conversion		(tree, tree, int);
 extern tree build_new_function_call		(tree, tree, bool);
@@ -4137,7 +4137,7 @@ extern void cxx_print_identifier		(FILE
 extern void cxx_print_error_function	(struct diagnostic_context *,
 						 const char *);
 extern void build_self_reference		(void);
-extern int same_signature_p			(tree, tree);
+extern int same_signature_p			(const_tree, const_tree);
 extern void maybe_add_class_template_decl_list	(tree, tree, int);
 extern void unreverse_member_declarations	(tree);
 extern void invalidate_class_lookup_cache	(void);
@@ -4214,11 +4214,11 @@ extern tree build_ptrmemfunc_type		(tree
 extern tree build_ptrmem_type			(tree, tree);
 /* the grokdeclarator prototype is in decl.h */
 extern tree build_this_parm			(tree, cp_cv_quals);
-extern int copy_fn_p				(tree);
-extern bool move_fn_p                           (tree);
+extern int copy_fn_p				(const_tree);
+extern bool move_fn_p                           (const_tree);
 extern tree get_scope_of_declarator		(const cp_declarator *);
 extern void grok_special_member_properties	(tree);
-extern int grok_ctor_properties			(tree, tree);
+extern int grok_ctor_properties			(const_tree, const_tree);
 extern bool grok_op_properties			(tree, bool);
 extern tree xref_tag				(enum tag_types, tree, tag_scope, bool);
 extern tree xref_tag_from_type			(tree, tree, tag_scope);
@@ -4320,7 +4320,7 @@ extern tree expand_start_catch_block		(t
 extern void expand_end_catch_block		(void);
 extern tree build_exc_ptr			(void);
 extern tree build_throw				(tree);
-extern int nothrow_libfn_p			(tree);
+extern int nothrow_libfn_p			(const_tree);
 extern void check_handlers			(tree);
 extern void choose_personality_routine		(enum languages);
 extern tree eh_type_info			(tree);
@@ -4384,8 +4384,8 @@ extern void use_thunk				(tree, bool);
 extern void synthesize_method			(tree);
 extern tree lazily_declare_fn			(special_function_kind,
 						 tree);
-extern tree skip_artificial_parms_for		(tree, tree);
-extern int num_artificial_parms_for		(tree);
+extern tree skip_artificial_parms_for		(const_tree, tree);
+extern int num_artificial_parms_for		(const_tree);
 extern tree make_alias_for			(tree, tree);
 extern tree locate_copy				(tree, void *);
 extern tree locate_ctor				(tree, void *);
@@ -4428,9 +4428,9 @@ extern int more_specialized_fn			(tree,
 extern void do_decl_instantiation		(tree, tree);
 extern void do_type_instantiation		(tree, tree, tsubst_flags_t);
 extern tree instantiate_decl			(tree, int, bool);
-extern int comp_template_parms			(tree, tree);
+extern int comp_template_parms			(const_tree, const_tree);
 extern bool uses_parameter_packs                (tree);
-extern bool template_parameter_pack_p           (tree);
+extern bool template_parameter_pack_p           (const_tree);
 extern tree make_pack_expansion                 (tree);
 extern bool check_for_bare_parameter_packs      (tree);
 extern int template_class_depth			(tree);
@@ -4452,13 +4452,13 @@ extern tree current_instantiation		(void
 extern tree maybe_get_template_decl_from_type_decl (tree);
 extern int processing_template_parmlist;
 extern bool dependent_type_p			(tree);
-extern bool any_dependent_template_arguments_p  (tree);
+extern bool any_dependent_template_arguments_p  (const_tree);
 extern bool dependent_template_p		(tree);
 extern bool dependent_template_id_p		(tree, tree);
 extern bool type_dependent_expression_p		(tree);
-extern bool any_type_dependent_arguments_p      (tree);
+extern bool any_type_dependent_arguments_p      (const_tree);
 extern bool value_dependent_expression_p	(tree);
-extern bool any_value_dependent_elements_p      (tree);
+extern bool any_value_dependent_elements_p      (const_tree);
 extern tree resolve_typename_type		(tree, bool);
 extern tree template_for_substitution		(tree);
 extern tree build_non_dependent_expr		(tree);
@@ -4471,7 +4471,7 @@ extern tree outermost_tinst_level		(void
 /* in repo.c */
 extern void init_repo				(void);
 extern int repo_emit_p				(tree);
-extern bool repo_export_class_p			(tree);
+extern bool repo_export_class_p			(const_tree);
 extern void finish_repo				(void);

 /* in rtti.c */
@@ -4664,7 +4664,7 @@ extern tree cxx_omp_clause_default_ctor
 extern tree cxx_omp_clause_copy_ctor		(tree, tree, tree);
 extern tree cxx_omp_clause_assign_op		(tree, tree, tree);
 extern tree cxx_omp_clause_dtor			(tree, tree);
-extern bool cxx_omp_privatize_by_reference	(tree);
+extern bool cxx_omp_privatize_by_reference	(const_tree);
 extern tree baselink_for_fns                    (tree);
 extern void finish_static_assert                (tree, tree, location_t,
                                                  bool);
@@ -4681,15 +4681,15 @@ extern bool stabilize_init			(tree, tree
 extern tree add_stmt_to_compound		(tree, tree);
 extern tree cxx_maybe_build_cleanup		(tree);
 extern void init_tree				(void);
-extern int pod_type_p				(tree);
+extern int pod_type_p				(const_tree);
 extern bool class_tmpl_impl_spec_p		(const_tree);
-extern int zero_init_p				(tree);
+extern int zero_init_p				(const_tree);
 extern tree canonical_type_variant		(tree);
 extern tree copy_binfo				(tree, tree, tree,
 						 tree *, int);
-extern int member_p				(tree);
-extern cp_lvalue_kind real_lvalue_p		(tree);
-extern bool builtin_valid_in_constant_expr_p    (tree);
+extern int member_p				(const_tree);
+extern cp_lvalue_kind real_lvalue_p		(const_tree);
+extern bool builtin_valid_in_constant_expr_p    (const_tree);
 extern tree build_min				(enum tree_code, tree, ...);
 extern tree build_min_nt			(enum tree_code, ...);
 extern tree build_min_non_dep			(enum tree_code, tree, ...);
@@ -4712,17 +4712,17 @@ extern tree array_type_nelts_top		(tree)
 extern tree break_out_target_exprs		(tree);
 extern tree get_type_decl			(tree);
 extern tree decl_namespace_context		(tree);
-extern bool decl_anon_ns_mem_p			(tree);
+extern bool decl_anon_ns_mem_p			(const_tree);
 extern tree lvalue_type				(tree);
 extern tree error_type				(tree);
-extern int varargs_function_p			(tree);
+extern int varargs_function_p			(const_tree);
 extern bool really_overloaded_fn		(tree);
 extern bool cp_tree_equal			(tree, tree);
 extern tree no_linkage_check			(tree, bool);
 extern void debug_binfo				(tree);
 extern tree build_dummy_object			(tree);
 extern tree maybe_dummy_object			(tree, tree *);
-extern int is_dummy_object			(tree);
+extern int is_dummy_object			(const_tree);
 extern const struct attribute_spec cxx_attribute_table[];
 extern tree make_ptrmem_cst			(tree, tree);
 extern tree cp_build_type_attribute_variant     (tree, tree);
@@ -4730,7 +4730,7 @@ extern tree cp_build_reference_type		(tr
 extern tree cp_build_qualified_type_real	(tree, int, tsubst_flags_t);
 #define cp_build_qualified_type(TYPE, QUALS) \
   cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error)
-extern special_function_kind special_function_p (tree);
+extern special_function_kind special_function_p (const_tree);
 extern int count_trees				(tree);
 extern int char_type_p				(tree);
 extern void verify_stmt_tree			(tree);
@@ -4748,24 +4748,24 @@ extern tree cp_save_expr			(tree);
 extern bool cast_valid_in_integral_constant_expression_p (tree);

 /* in typeck.c */
-extern int string_conv_p			(tree, tree, int);
+extern int string_conv_p			(const_tree, const_tree, int);
 extern tree cp_truthvalue_conversion		(tree);
 extern tree condition_conversion		(tree);
 extern tree require_complete_type		(tree);
 extern tree complete_type			(tree);
 extern tree complete_type_or_else		(tree, tree);
-extern int type_unknown_p			(tree);
-extern bool comp_except_specs			(tree, tree, bool);
+extern int type_unknown_p			(const_tree);
+extern bool comp_except_specs			(const_tree, const_tree, bool);
 extern bool comptypes				(tree, tree, int);
-extern bool compparms				(tree, tree);
-extern int comp_cv_qualification		(tree, tree);
+extern bool compparms				(const_tree, const_tree);
+extern int comp_cv_qualification		(const_tree, const_tree);
 extern int comp_cv_qual_signature		(tree, tree);
 extern tree cxx_sizeof_or_alignof_expr		(tree, enum tree_code);
 extern tree cxx_sizeof_or_alignof_type		(tree, enum tree_code, bool);
 #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false)
 extern tree inline_conversion			(tree);
-extern tree is_bitfield_expr_with_lowered_type  (tree);
-extern tree unlowered_expr_type                 (tree);
+extern tree is_bitfield_expr_with_lowered_type  (const_tree);
+extern tree unlowered_expr_type                 (const_tree);
 extern tree decay_conversion			(tree);
 extern tree build_class_member_access_expr      (tree, tree, tree, bool);
 extern tree finish_class_member_access_expr     (tree, tree, bool);
@@ -4792,12 +4792,12 @@ extern tree convert_for_initialization
 						 const char *, tree, int);
 extern int comp_ptr_ttypes			(tree, tree);
 extern bool comp_ptr_ttypes_const		(tree, tree);
-extern int ptr_reasonably_similar		(tree, tree);
+extern int ptr_reasonably_similar		(const_tree, const_tree);
 extern tree build_ptrmemfunc			(tree, tree, int, bool);
 extern int cp_type_quals			(const_tree);
-extern bool cp_type_readonly			(tree);
-extern bool cp_has_mutable_p			(tree);
-extern bool at_least_as_qualified_p		(tree, tree);
+extern bool cp_type_readonly			(const_tree);
+extern bool cp_has_mutable_p			(const_tree);
+extern bool at_least_as_qualified_p		(const_tree, const_tree);
 extern void cp_apply_type_quals_to_decl		(int, tree);
 extern tree build_ptrmemfunc1			(tree, tree, tree);
 extern void expand_ptrmemfunc_cst		(tree, tree *, tree *);
@@ -4814,11 +4814,11 @@ extern tree build_address			(tree);
 extern tree build_nop				(tree, tree);
 extern tree non_reference			(tree);
 extern tree lookup_anon_field			(tree, tree);
-extern bool invalid_nonstatic_memfn_p		(tree);
+extern bool invalid_nonstatic_memfn_p		(const_tree);
 extern tree convert_member_func_to_ptr		(tree, tree);
 extern tree convert_ptrmem			(tree, tree, bool, bool);
-extern int lvalue_or_else			(tree, enum lvalue_use);
-extern int lvalue_p				(tree);
+extern int lvalue_or_else			(const_tree, enum lvalue_use);
+extern int lvalue_p				(const_tree);

 /* in typeck2.c */
 extern void require_complete_eh_spec_types	(tree, tree);
diff -rup orig/egcc-SVN20070824/gcc/cp/decl.c egcc-SVN20070824/gcc/cp/decl.c
--- orig/egcc-SVN20070824/gcc/cp/decl.c	2007-08-20 20:03:15.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/decl.c	2007-08-24 23:49:07.165005310 -0400
@@ -9204,7 +9204,7 @@ grokparms (cp_parameter_declarator *firs
    operator.  */

 int
-copy_fn_p (tree d)
+copy_fn_p (const_tree d)
 {
   tree args;
   tree arg_type;
@@ -9260,7 +9260,7 @@ copy_fn_p (tree d)
    operator, false otherwise.  */

 bool
-move_fn_p (tree d)
+move_fn_p (const_tree d)
 {
   tree args;
   tree arg_type;
@@ -9359,7 +9359,7 @@ void grok_special_member_properties (tre
    if the class has a constructor of the form X(X).  */

 int
-grok_ctor_properties (tree ctype, tree decl)
+grok_ctor_properties (const_tree ctype, const_tree decl)
 {
   int ctor_parm = copy_fn_p (decl);

diff -rup orig/egcc-SVN20070824/gcc/cp/except.c egcc-SVN20070824/gcc/cp/except.c
--- orig/egcc-SVN20070824/gcc/cp/except.c	2007-08-20 20:03:17.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/except.c	2007-08-24 23:49:07.167012489 -0400
@@ -905,7 +905,7 @@ is_admissible_throw_operand (tree expr)
 #include "cfns.h"

 int
-nothrow_libfn_p (tree fn)
+nothrow_libfn_p (const_tree fn)
 {
   tree id;

diff -rup orig/egcc-SVN20070824/gcc/cp/method.c egcc-SVN20070824/gcc/cp/method.c
--- orig/egcc-SVN20070824/gcc/cp/method.c	2007-08-06 20:02:18.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/method.c	2007-08-24 23:49:07.168767291 -0400
@@ -1185,7 +1185,7 @@ lazily_declare_fn (special_function_kind
    as there are artificial parms in FN.  */

 tree
-skip_artificial_parms_for (tree fn, tree list)
+skip_artificial_parms_for (const_tree fn, tree list)
 {
   if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
     list = TREE_CHAIN (list);
@@ -1203,7 +1203,7 @@ skip_artificial_parms_for (tree fn, tree
    artificial parms in FN.  */

 int
-num_artificial_parms_for (tree fn)
+num_artificial_parms_for (const_tree fn)
 {
   int count = 0;

diff -rup orig/egcc-SVN20070824/gcc/cp/pt.c egcc-SVN20070824/gcc/cp/pt.c
--- orig/egcc-SVN20070824/gcc/cp/pt.c	2007-08-23 20:02:49.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/pt.c	2007-08-24 23:49:07.185915057 -0400
@@ -2262,10 +2262,10 @@ check_explicit_specialization (tree decl
    DECL_TEMPLATE_PARMS.  */

 int
-comp_template_parms (tree parms1, tree parms2)
+comp_template_parms (const_tree parms1, const_tree parms2)
 {
-  tree p1;
-  tree p2;
+  const_tree p1;
+  const_tree p2;

   if (parms1 == parms2)
     return 1;
@@ -2316,7 +2316,7 @@ comp_template_parms (tree parms1, tree p

 /* Determine whether PARM is a parameter pack.  */
 bool
-template_parameter_pack_p (tree parm)
+template_parameter_pack_p (const_tree parm)
 {
   /* Determine if we have a non-type template parameter pack.  */
   if (TREE_CODE (parm) == PARM_DECL)
@@ -15322,7 +15322,7 @@ type_dependent_expression_p (tree expres
    contains a type-dependent expression.  */

 bool
-any_type_dependent_arguments_p (tree args)
+any_type_dependent_arguments_p (const_tree args)
 {
   while (args)
     {
@@ -15339,7 +15339,7 @@ any_type_dependent_arguments_p (tree arg
    expressions) contains any value-dependent expressions.  */

 bool
-any_value_dependent_elements_p (tree list)
+any_value_dependent_elements_p (const_tree list)
 {
   for (; list; list = TREE_CHAIN (list))
     if (value_dependent_expression_p (TREE_VALUE (list)))
@@ -15434,7 +15434,7 @@ any_template_arguments_need_structural_e
    any dependent arguments.  */

 bool
-any_dependent_template_arguments_p (tree args)
+any_dependent_template_arguments_p (const_tree args)
 {
   int i;
   int j;
@@ -15446,7 +15446,7 @@ any_dependent_template_arguments_p (tree

   for (i = 0; i < TMPL_ARGS_DEPTH (args); ++i)
     {
-      tree level = TMPL_ARGS_LEVEL (args, i + 1);
+      const_tree level = TMPL_ARGS_LEVEL (args, i + 1);
       for (j = 0; j < TREE_VEC_LENGTH (level); ++j)
 	if (dependent_template_arg_p (TREE_VEC_ELT (level, j)))
 	  return true;
diff -rup orig/egcc-SVN20070824/gcc/cp/repo.c egcc-SVN20070824/gcc/cp/repo.c
--- orig/egcc-SVN20070824/gcc/cp/repo.c	2007-08-02 10:19:32.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/repo.c	2007-08-24 23:49:07.187670179 -0400
@@ -347,7 +347,7 @@ repo_emit_p (tree decl)
    export from this translation unit.  */

 bool
-repo_export_class_p (tree class_type)
+repo_export_class_p (const_tree class_type)
 {
   if (!flag_use_repository)
     return false;
diff -rup orig/egcc-SVN20070824/gcc/cp/semantics.c egcc-SVN20070824/gcc/cp/semantics.c
--- orig/egcc-SVN20070824/gcc/cp/semantics.c	2007-08-20 20:03:22.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/semantics.c	2007-08-24 23:49:07.192407344 -0400
@@ -436,7 +436,7 @@ add_decl_expr (tree decl)
    declared is not an anonymous union" [class.union].  */

 int
-anon_aggr_type_p (tree node)
+anon_aggr_type_p (const_tree node)
 {
   return ANON_AGGR_TYPE_P (node);
 }
diff -rup orig/egcc-SVN20070824/gcc/cp/tree.c egcc-SVN20070824/gcc/cp/tree.c
--- orig/egcc-SVN20070824/gcc/cp/tree.c	2007-08-24 15:15:34.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/tree.c	2007-08-24 23:49:07.196546051 -0400
@@ -43,7 +43,7 @@ static tree build_cplus_array_type_1 (tr
 static int list_hash_eq (const void *, const void *);
 static hashval_t list_hash_pieces (tree, tree, tree);
 static hashval_t list_hash (const void *);
-static cp_lvalue_kind lvalue_p_1 (tree, int);
+static cp_lvalue_kind lvalue_p_1 (const_tree, int);
 static tree build_target_expr (tree, tree);
 static tree count_trees_r (tree *, int *, void *);
 static tree verify_stmt_tree_r (tree *, int *, void *);
@@ -58,7 +58,7 @@ static tree handle_init_priority_attribu
    nonzero, rvalues of class type are considered lvalues.  */

 static cp_lvalue_kind
-lvalue_p_1 (tree ref,
+lvalue_p_1 (const_tree ref,
 	    int treat_class_rvalues_as_lvalues)
 {
   cp_lvalue_kind op1_lvalue_kind = clk_none;
@@ -223,7 +223,7 @@ lvalue_p_1 (tree ref,
    computes the C++ definition of lvalue.  */

 cp_lvalue_kind
-real_lvalue_p (tree ref)
+real_lvalue_p (const_tree ref)
 {
   return lvalue_p_1 (ref,
 		     /*treat_class_rvalues_as_lvalues=*/0);
@@ -233,7 +233,7 @@ real_lvalue_p (tree ref)
    considered lvalues.  */

 int
-lvalue_p (tree ref)
+lvalue_p (const_tree ref)
 {
   return
     (lvalue_p_1 (ref, /*class rvalue ok*/ 1) != clk_none);
@@ -243,7 +243,7 @@ lvalue_p (tree ref)
    constant-expression. */

 bool
-builtin_valid_in_constant_expr_p (tree decl)
+builtin_valid_in_constant_expr_p (const_tree decl)
 {
   /* At present BUILT_IN_CONSTANT_P is the only builtin we're allowing
      in constant-expressions.  We may want to add other builtins later. */
@@ -1673,7 +1673,7 @@ decl_namespace_context (tree decl)
    nested, or false otherwise.  */

 bool
-decl_anon_ns_mem_p (tree decl)
+decl_anon_ns_mem_p (const_tree decl)
 {
   while (1)
     {
@@ -1971,9 +1971,9 @@ error_type (tree arg)
 /* Does FUNCTION use a variable-length argument list?  */

 int
-varargs_function_p (tree function)
+varargs_function_p (const_tree function)
 {
-  tree parm = TYPE_ARG_TYPES (TREE_TYPE (function));
+  const_tree parm = TYPE_ARG_TYPES (TREE_TYPE (function));
   for (; parm; parm = TREE_CHAIN (parm))
     if (TREE_VALUE (parm) == void_type_node)
       return 0;
@@ -1983,9 +1983,9 @@ varargs_function_p (tree function)
 /* Returns 1 if decl is a member of a class.  */

 int
-member_p (tree decl)
+member_p (const_tree decl)
 {
-  const tree ctx = DECL_CONTEXT (decl);
+  const_tree const ctx = DECL_CONTEXT (decl);
   return (ctx && TYPE_P (ctx));
 }

@@ -2039,7 +2039,7 @@ maybe_dummy_object (tree type, tree* bin
 /* Returns 1 if OB is a placeholder object, or a pointer to one.  */

 int
-is_dummy_object (tree ob)
+is_dummy_object (const_tree ob)
 {
   if (TREE_CODE (ob) == INDIRECT_REF)
     ob = TREE_OPERAND (ob, 0);
@@ -2050,9 +2050,9 @@ is_dummy_object (tree ob)
 /* Returns 1 iff type T is a POD type, as defined in [basic.types].  */

 int
-pod_type_p (tree t)
+pod_type_p (const_tree t)
 {
-  t = strip_array_types (t);
+  t = const_strip_array_types (t);

   if (t == error_mark_node)
     return 1;
@@ -2087,9 +2087,9 @@ class_tmpl_impl_spec_p (const_tree t)
    zeros in it.  */

 int
-zero_init_p (tree t)
+zero_init_p (const_tree t)
 {
-  t = strip_array_types (t);
+  t = const_strip_array_types (t);

   if (t == error_mark_node)
     return 1;
@@ -2425,7 +2425,7 @@ init_tree (void)
    predicate to test whether or not DECL is a special function.  */

 special_function_kind
-special_function_p (tree decl)
+special_function_p (const_tree decl)
 {
   /* Rather than doing all this stuff with magic names, we should
      probably have a field of type `special_function_kind' in
diff -rup orig/egcc-SVN20070824/gcc/cp/typeck.c egcc-SVN20070824/gcc/cp/typeck.c
--- orig/egcc-SVN20070824/gcc/cp/typeck.c	2007-08-24 15:15:34.000000000 -0400
+++ egcc-SVN20070824/gcc/cp/typeck.c	2007-08-24 23:49:07.205360869 -0400
@@ -51,7 +51,7 @@ static tree cp_pointer_int_sum (enum tre
 static tree rationalize_conditional_expr (enum tree_code, tree);
 static int comp_ptr_ttypes_real (tree, tree, int);
 static bool comp_except_types (tree, tree, bool);
-static bool comp_array_types (tree, tree, bool);
+static bool comp_array_types (const_tree, const_tree, bool);
 static tree pointer_diff (tree, tree, tree);
 static tree get_delta_difference (tree, tree, bool, bool);
 static void casts_away_constness_r (tree *, tree *);
@@ -151,7 +151,7 @@ complete_type_or_else (tree type, tree v
 /* Return truthvalue of whether type of EXP is instantiated.  */

 int
-type_unknown_p (tree exp)
+type_unknown_p (const_tree exp)
 {
   return (TREE_CODE (exp) == TREE_LIST
 	  || TREE_TYPE (exp) == unknown_type_node);
@@ -820,10 +820,10 @@ comp_except_types (tree a, tree b, bool
    we should try to make use of that.  */

 bool
-comp_except_specs (tree t1, tree t2, bool exact)
+comp_except_specs (const_tree t1, const_tree t2, bool exact)
 {
-  tree probe;
-  tree base;
+  const_tree probe;
+  const_tree base;
   int  length = 0;

   if (t1 == t2)
@@ -867,7 +867,7 @@ comp_except_specs (tree t1, tree t2, boo
    [] can match [size].  */

 static bool
-comp_array_types (tree t1, tree t2, bool allow_redeclaration)
+comp_array_types (const_tree t1, const_tree t2, bool allow_redeclaration)
 {
   tree d1;
   tree d2;
@@ -1154,7 +1154,7 @@ comptypes (tree t1, tree t2, int strict)
 /* Returns 1 if TYPE1 is at least as qualified as TYPE2.  */

 bool
-at_least_as_qualified_p (tree type1, tree type2)
+at_least_as_qualified_p (const_tree type1, const_tree type2)
 {
   int q1 = cp_type_quals (type1);
   int q2 = cp_type_quals (type2);
@@ -1167,7 +1167,7 @@ at_least_as_qualified_p (tree type1, tre
    more cv-qualified that TYPE1, and 0 otherwise.  */

 int
-comp_cv_qualification (tree type1, tree type2)
+comp_cv_qualification (const_tree type1, const_tree type2)
 {
   int q1 = cp_type_quals (type1);
   int q2 = cp_type_quals (type2);
@@ -1206,9 +1206,9 @@ comp_cv_qual_signature (tree type1, tree
    element by element.  */

 bool
-compparms (tree parms1, tree parms2)
+compparms (const_tree parms1, const_tree parms2)
 {
-  tree t1, t2;
+  const_tree t1, t2;

   /* An unspecified parmlist matches any specified parmlist
      whose argument types don't need default promotions.  */
@@ -1398,7 +1398,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum
    violates these rules.  */

 bool
-invalid_nonstatic_memfn_p (tree expr)
+invalid_nonstatic_memfn_p (const_tree expr)
 {
   if (TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE)
     {
@@ -1413,7 +1413,7 @@ invalid_nonstatic_memfn_p (tree expr)
    of the bitfield.  Otherwise, return NULL_TREE.  */

 tree
-is_bitfield_expr_with_lowered_type (tree exp)
+is_bitfield_expr_with_lowered_type (const_tree exp)
 {
   switch (TREE_CODE (exp))
     {
@@ -1452,7 +1452,7 @@ is_bitfield_expr_with_lowered_type (tree
    than NULL_TREE.  */

 tree
-unlowered_expr_type (tree exp)
+unlowered_expr_type (const_tree exp)
 {
   tree type;

@@ -1633,7 +1633,7 @@ inline_conversion (tree exp)
    decay_conversion to one.  */

 int
-string_conv_p (tree totype, tree exp, int warn)
+string_conv_p (const_tree totype, const_tree exp, int warn)
 {
   tree t;

@@ -6853,7 +6853,7 @@ comp_ptr_ttypes (tree to, tree from)
    type or inheritance-related types, regardless of cv-quals.  */

 int
-ptr_reasonably_similar (tree to, tree from)
+ptr_reasonably_similar (const_tree to, const_tree from)
 {
   for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
     {
@@ -6927,18 +6927,18 @@ cp_type_quals (const_tree type)
    arrays.  */

 bool
-cp_type_readonly (tree type)
+cp_type_readonly (const_tree type)
 {
-  type = strip_array_types (type);
+  type = const_strip_array_types (type);
   return TYPE_READONLY (type);
 }

 /* Returns nonzero if the TYPE contains a mutable member.  */

 bool
-cp_has_mutable_p (tree type)
+cp_has_mutable_p (const_tree type)
 {
-  type = strip_array_types (type);
+  type = const_strip_array_types (type);

   return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type);
 }
@@ -7110,7 +7110,7 @@ non_reference (tree t)
    how the lvalue is being used and so selects the error message.  */

 int
-lvalue_or_else (tree ref, enum lvalue_use use)
+lvalue_or_else (const_tree ref, enum lvalue_use use)
 {
   int win = lvalue_p (ref);

diff -rup orig/egcc-SVN20070824/gcc/fortran/trans-openmp.c egcc-SVN20070824/gcc/fortran/trans-openmp.c
--- orig/egcc-SVN20070824/gcc/fortran/trans-openmp.c	2007-08-01 23:05:11.000000000 -0400
+++ egcc-SVN20070824/gcc/fortran/trans-openmp.c	2007-08-24 23:49:07.207389654 -0400
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3.
    than the DECL itself.  */

 bool
-gfc_omp_privatize_by_reference (tree decl)
+gfc_omp_privatize_by_reference (const_tree decl)
 {
   tree type = TREE_TYPE (decl);

diff -rup orig/egcc-SVN20070824/gcc/fortran/trans.h egcc-SVN20070824/gcc/fortran/trans.h
--- orig/egcc-SVN20070824/gcc/fortran/trans.h	2007-08-10 20:02:29.000000000 -0400
+++ egcc-SVN20070824/gcc/fortran/trans.h	2007-08-24 23:49:07.208672508 -0400
@@ -474,7 +474,7 @@ tree gfc_truthvalue_conversion (tree);
 tree gfc_builtin_function (tree);

 /* In trans-openmp.c */
-bool gfc_omp_privatize_by_reference (tree);
+bool gfc_omp_privatize_by_reference (const_tree);
 enum omp_clause_default_kind gfc_omp_predetermined_sharing (tree);
 tree gfc_omp_clause_default_ctor (tree, tree);
 bool gfc_omp_disregard_value_expr (tree, bool);
diff -rup orig/egcc-SVN20070824/gcc/ggc-common.c egcc-SVN20070824/gcc/ggc-common.c
--- orig/egcc-SVN20070824/gcc/ggc-common.c	2007-07-26 23:03:59.000000000 -0400
+++ egcc-SVN20070824/gcc/ggc-common.c	2007-08-24 23:49:07.210527572 -0400
@@ -357,8 +357,8 @@ call_alloc (void **slot, void *state_p)
 static int
 compare_ptr_data (const void *p1_p, const void *p2_p)
 {
-  struct ptr_data *p1 = *(struct ptr_data *const *)p1_p;
-  struct ptr_data *p2 = *(struct ptr_data *const *)p2_p;
+  const struct ptr_data *const p1 = *(const struct ptr_data *const *)p1_p;
+  const struct ptr_data *const p2 = *(const struct ptr_data *const *)p2_p;
   return (((size_t)p1->new_addr > (size_t)p2->new_addr)
 	  - ((size_t)p1->new_addr < (size_t)p2->new_addr));
 }
@@ -794,7 +794,7 @@ static htab_t loc_hash;
 static hashval_t
 hash_descriptor (const void *p)
 {
-  const struct loc_descriptor *d = p;
+  const struct loc_descriptor *const d = p;

   return htab_hash_pointer (d->function) | d->line;
 }
@@ -802,8 +802,8 @@ hash_descriptor (const void *p)
 static int
 eq_descriptor (const void *p1, const void *p2)
 {
-  const struct loc_descriptor *d = p1;
-  const struct loc_descriptor *d2 = p2;
+  const struct loc_descriptor *const d = p1;
+  const struct loc_descriptor *const d2 = p2;

   return (d->file == d2->file && d->line == d2->line
 	  && d->function == d2->function);
@@ -822,7 +822,7 @@ struct ptr_hash_entry
 static hashval_t
 hash_ptr (const void *p)
 {
-  const struct ptr_hash_entry *d = p;
+  const struct ptr_hash_entry *const d = p;

   return htab_hash_pointer (d->ptr);
 }
@@ -830,7 +830,7 @@ hash_ptr (const void *p)
 static int
 eq_ptr (const void *p1, const void *p2)
 {
-  const struct ptr_hash_entry *p = p1;
+  const struct ptr_hash_entry *const p = p1;

   return (p->ptr == p2);
 }
diff -rup orig/egcc-SVN20070824/gcc/java/lang.c egcc-SVN20070824/gcc/java/lang.c
--- orig/egcc-SVN20070824/gcc/java/lang.c	2007-08-20 20:02:48.000000000 -0400
+++ egcc-SVN20070824/gcc/java/lang.c	2007-08-24 23:49:07.212051601 -0400
@@ -59,7 +59,7 @@ static int merge_init_test_initializatio
 static int inline_init_test_initialization (void * *, void *);
 static bool java_dump_tree (void *, tree);
 static void dump_compound_expr (dump_info_p, tree);
-static bool java_decl_ok_for_sibcall (tree);
+static bool java_decl_ok_for_sibcall (const_tree);
 static tree java_get_callee_fndecl (const_tree);
 static void java_clear_binding_stack (void);

@@ -894,7 +894,7 @@ java_dump_tree (void *dump_info, tree t)
    SecurityManager.getClassContext().  */

 static bool
-java_decl_ok_for_sibcall (tree decl)
+java_decl_ok_for_sibcall (const_tree decl)
 {
   return (decl != NULL && DECL_CONTEXT (decl) == output_class
 	  && DECL_INLINE (decl));
diff -rup orig/egcc-SVN20070824/gcc/langhooks-def.h egcc-SVN20070824/gcc/langhooks-def.h
--- orig/egcc-SVN20070824/gcc/langhooks-def.h	2007-08-24 15:16:14.000000000 -0400
+++ egcc-SVN20070824/gcc/langhooks-def.h	2007-08-24 23:49:07.213100001 -0400
@@ -59,7 +59,7 @@ extern bool lhd_warn_unused_global_decl
 extern void lhd_incomplete_type_error (const_tree, const_tree);
 extern tree lhd_type_promotes_to (tree);
 extern void lhd_register_builtin_type (tree, const char *);
-extern bool lhd_decl_ok_for_sibcall (tree);
+extern bool lhd_decl_ok_for_sibcall (const_tree);
 extern const char *lhd_comdat_group (tree);
 extern tree lhd_expr_size (const_tree);
 extern size_t lhd_tree_size (enum tree_code);
@@ -204,7 +204,7 @@ extern tree lhd_make_node (enum tree_cod
 #define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
 #define LANG_HOOKS_DECL_OK_FOR_SIBCALL	lhd_decl_ok_for_sibcall
 #define LANG_HOOKS_COMDAT_GROUP lhd_comdat_group
-#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_tree_false
+#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_const_tree_false
 #define LANG_HOOKS_OMP_PREDETERMINED_SHARING lhd_omp_predetermined_sharing
 #define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR hook_bool_tree_bool_false
 #define LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE hook_bool_tree_bool_false
diff -rup orig/egcc-SVN20070824/gcc/langhooks.c egcc-SVN20070824/gcc/langhooks.c
--- orig/egcc-SVN20070824/gcc/langhooks.c	2007-08-24 15:16:11.000000000 -0400
+++ egcc-SVN20070824/gcc/langhooks.c	2007-08-24 23:49:07.214080786 -0400
@@ -330,7 +330,7 @@ lhd_tree_size (enum tree_code c ATTRIBUT
    sibcall.  */

 bool
-lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED)
+lhd_decl_ok_for_sibcall (const_tree decl ATTRIBUTE_UNUSED)
 {
   return true;
 }
diff -rup orig/egcc-SVN20070824/gcc/langhooks.h egcc-SVN20070824/gcc/langhooks.h
--- orig/egcc-SVN20070824/gcc/langhooks.h	2007-08-24 15:16:11.000000000 -0400
+++ egcc-SVN20070824/gcc/langhooks.h	2007-08-24 23:49:07.215248413 -0400
@@ -166,7 +166,7 @@ struct lang_hooks_for_decls
   void (*final_write_globals) (void);

   /* True if this decl may be called via a sibcall.  */
-  bool (*ok_for_sibcall) (tree);
+  bool (*ok_for_sibcall) (const_tree);

   /* Return the COMDAT group into which this DECL should be placed.
      It is known that the DECL belongs in *some* COMDAT group when
@@ -179,7 +179,7 @@ struct lang_hooks_for_decls

   /* True if OpenMP should privatize what this DECL points to rather
      than the DECL itself.  */
-  bool (*omp_privatize_by_reference) (tree);
+  bool (*omp_privatize_by_reference) (const_tree);

   /* Return sharing kind if OpenMP sharing attribute of DECL is
      predetermined, OMP_CLAUSE_DEFAULT_UNSPECIFIED otherwise.  */
diff -rup orig/egcc-SVN20070824/gcc/optabs.c egcc-SVN20070824/gcc/optabs.c
--- orig/egcc-SVN20070824/gcc/optabs.c	2007-08-09 19:21:50.000000000 -0400
+++ egcc-SVN20070824/gcc/optabs.c	2007-08-24 23:49:07.221967072 -0400
@@ -256,7 +256,7 @@ widen_operand (rtx op, enum machine_mode
    or division) but probably ought to be relied on more widely
    throughout the expander.  */
 optab
-optab_for_tree_code (enum tree_code code, tree type)
+optab_for_tree_code (enum tree_code code, const_tree type)
 {
   bool trapv;
   switch (code)
diff -rup orig/egcc-SVN20070824/gcc/optabs.h egcc-SVN20070824/gcc/optabs.h
--- orig/egcc-SVN20070824/gcc/optabs.h	2007-08-09 19:21:50.000000000 -0400
+++ egcc-SVN20070824/gcc/optabs.h	2007-08-24 23:49:07.223498382 -0400
@@ -667,7 +667,7 @@ enum can_compare_purpose

 /* Return the optab used for computing the given operation on the type
    given by the second argument.  */
-extern optab optab_for_tree_code (enum tree_code, tree);
+extern optab optab_for_tree_code (enum tree_code, const_tree);

 /* Nonzero if a compare of mode MODE can be done straightforwardly
    (without splitting it into pieces).  */
diff -rup orig/egcc-SVN20070824/gcc/rtl.h egcc-SVN20070824/gcc/rtl.h
--- orig/egcc-SVN20070824/gcc/rtl.h	2007-08-24 15:16:14.000000000 -0400
+++ egcc-SVN20070824/gcc/rtl.h	2007-08-24 23:49:07.226381282 -0400
@@ -1663,7 +1663,7 @@ extern rtx simplify_subreg (enum machine
 extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
 				unsigned int);
 extern rtx simplify_replace_rtx (rtx, const_rtx, rtx);
-extern rtx simplify_rtx (rtx);
+extern rtx simplify_rtx (const_rtx);
 extern rtx avoid_constant_pool_reference (rtx);
 extern bool mode_signbit_p (enum machine_mode, const_rtx);

diff -rup orig/egcc-SVN20070824/gcc/simplify-rtx.c egcc-SVN20070824/gcc/simplify-rtx.c
--- orig/egcc-SVN20070824/gcc/simplify-rtx.c	2007-08-22 20:03:48.000000000 -0400
+++ egcc-SVN20070824/gcc/simplify-rtx.c	2007-08-24 23:49:07.231375385 -0400
@@ -5019,10 +5019,10 @@ simplify_gen_subreg (enum machine_mode o
     simplification and 1 for tree simplification.  */

 rtx
-simplify_rtx (rtx x)
+simplify_rtx (const_rtx x)
 {
-  enum rtx_code code = GET_CODE (x);
-  enum machine_mode mode = GET_MODE (x);
+  const enum rtx_code code = GET_CODE (x);
+  const enum machine_mode mode = GET_MODE (x);

   switch (GET_RTX_CLASS (code))
     {
diff -rup orig/egcc-SVN20070824/gcc/tree-dump.c egcc-SVN20070824/gcc/tree-dump.c
--- orig/egcc-SVN20070824/gcc/tree-dump.c	2007-08-08 20:01:46.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-dump.c	2007-08-24 23:49:07.233587011 -0400
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3.
 #include "real.h"
 #include "fixed-value.h"

-static unsigned int queue (dump_info_p, tree, int);
+static unsigned int queue (dump_info_p, const_tree, int);
 static void dump_index (dump_info_p, unsigned int);
 static void dequeue_and_dump (dump_info_p);
 static void dump_new_line (dump_info_p);
@@ -45,7 +45,7 @@ static int dump_enable_all (int, int);
    assigned to T.  */

 static unsigned int
-queue (dump_info_p di, tree t, int flags)
+queue (dump_info_p di, const_tree t, int flags)
 {
   dump_queue_p dq;
   dump_node_info_p dni;
@@ -94,7 +94,7 @@ dump_index (dump_info_p di, unsigned int
    index of T is printed.  */

 void
-queue_and_dump_index (dump_info_p di, const char *field, tree t, int flags)
+queue_and_dump_index (dump_info_p di, const char *field, const_tree t, int flags)
 {
   unsigned int index;
   splay_tree_node n;
@@ -122,7 +122,7 @@ queue_and_dump_index (dump_info_p di, co
 /* Dump the type of T.  */

 void
-queue_and_dump_type (dump_info_p di, tree t)
+queue_and_dump_type (dump_info_p di, const_tree t)
 {
   queue_and_dump_index (di, "type", TREE_TYPE (t), DUMP_NONE);
 }
@@ -735,7 +735,7 @@ dequeue_and_dump (dump_info_p di)
 /* Return nonzero if FLAG has been specified for the dump, and NODE
    is not the root node of the dump.  */

-int dump_flag (dump_info_p di, int flag, tree node)
+int dump_flag (dump_info_p di, int flag, const_tree node)
 {
   return (di->flags & flag) && (node != di->node);
 }
@@ -743,7 +743,7 @@ int dump_flag (dump_info_p di, int flag,
 /* Dump T, and all its children, on STREAM.  */

 void
-dump_node (tree t, int flags, FILE *stream)
+dump_node (const_tree t, int flags, FILE *stream)
 {
   struct dump_info di;
   dump_queue_p dq;
diff -rup orig/egcc-SVN20070824/gcc/tree-dump.h egcc-SVN20070824/gcc/tree-dump.h
--- orig/egcc-SVN20070824/gcc/tree-dump.h	2007-07-26 23:03:29.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-dump.h	2007-08-24 23:49:07.234469214 -0400
@@ -58,7 +58,7 @@ struct dump_info
   /* The stream on which to dump the information.  */
   FILE *stream;
   /* The original node.  */
-  tree node;
+  const_tree node;
   /* User flags.  */
   int flags;
   /* The next unused node index.  */
@@ -85,13 +85,13 @@ extern void dump_pointer (dump_info_p, c
 extern void dump_int (dump_info_p, const char *, int);
 extern void dump_string (dump_info_p, const char *);
 extern void dump_string_field (dump_info_p, const char *, const char *);
-extern void dump_stmt (dump_info_p, tree);
-extern void queue_and_dump_index (dump_info_p, const char *, tree, int);
-extern void queue_and_dump_type (dump_info_p, tree);
+extern void dump_stmt (dump_info_p, const_tree);
+extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int);
+extern void queue_and_dump_type (dump_info_p, const_tree);
 extern void dump_function (enum tree_dump_index, tree);
 extern void dump_function_to_file (tree, FILE *, int);
 extern void debug_function (tree, int);
-extern int dump_flag (dump_info_p, int, tree);
+extern int dump_flag (dump_info_p, int, const_tree);

 extern unsigned int dump_register (const char *, const char *, const char *,
 				   int, int);
diff -rup orig/egcc-SVN20070824/gcc/tree-flow.h egcc-SVN20070824/gcc/tree-flow.h
--- orig/egcc-SVN20070824/gcc/tree-flow.h	2007-08-19 20:03:40.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-flow.h	2007-08-24 23:49:07.236198490 -0400
@@ -961,7 +961,7 @@ struct tree_niter_desc

 /* In tree-vectorizer.c */
 unsigned vectorize_loops (void);
-extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
+extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
 extern tree get_vectype_for_scalar_type (tree);

 /* In tree-ssa-phiopt.c */
diff -rup orig/egcc-SVN20070824/gcc/tree-pass.h egcc-SVN20070824/gcc/tree-pass.h
--- orig/egcc-SVN20070824/gcc/tree-pass.h	2007-08-14 20:02:16.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-pass.h	2007-08-24 23:49:07.237308984 -0400
@@ -78,7 +78,7 @@ extern int dump_enabled_p (enum tree_dum
 extern int dump_initialized_p (enum tree_dump_index);
 extern FILE *dump_begin (enum tree_dump_index, int *);
 extern void dump_end (enum tree_dump_index, FILE *);
-extern void dump_node (tree, int, FILE *);
+extern void dump_node (const_tree, int, FILE *);
 extern int dump_switch_p (const char *);
 extern const char *dump_flag_name (enum tree_dump_index);

diff -rup orig/egcc-SVN20070824/gcc/tree-vectorizer.c egcc-SVN20070824/gcc/tree-vectorizer.c
--- orig/egcc-SVN20070824/gcc/tree-vectorizer.c	2007-08-23 12:12:26.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-vectorizer.c	2007-08-24 23:49:07.240398171 -0400
@@ -1583,7 +1583,7 @@ destroy_loop_vec_info (loop_vec_info loo
    on ALIGNMENT bit boundary.  */

 bool
-vect_can_force_dr_alignment_p (tree decl, unsigned int alignment)
+vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
 {
   if (TREE_CODE (decl) != VAR_DECL)
     return false;
@@ -2061,7 +2061,7 @@ supportable_widening_operation (enum tre

 bool
 supportable_narrowing_operation (enum tree_code code,
-				 tree stmt, tree vectype,
+				 const_tree stmt, const_tree vectype,
 				 enum tree_code *code1)
 {
   enum machine_mode vec_mode;
diff -rup orig/egcc-SVN20070824/gcc/tree-vectorizer.h egcc-SVN20070824/gcc/tree-vectorizer.h
--- orig/egcc-SVN20070824/gcc/tree-vectorizer.h	2007-08-19 20:03:38.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-vectorizer.h	2007-08-24 23:49:07.241675344 -0400
@@ -506,14 +506,14 @@ extern bool vect_is_simple_use (tree, lo
 				enum vect_def_type *);
 extern bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *);
 extern tree vect_is_simple_reduction (loop_vec_info, tree);
-extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
+extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
 extern enum dr_alignment_support vect_supportable_dr_alignment
   (struct data_reference *);
 extern bool reduction_code_for_scalar_code (enum tree_code, enum tree_code *);
 extern bool supportable_widening_operation (enum tree_code, tree, tree,
   tree *, tree *, enum tree_code *, enum tree_code *);
-extern bool supportable_narrowing_operation (enum tree_code, tree, tree,
-					     enum tree_code *);
+extern bool supportable_narrowing_operation (enum tree_code, const_tree,
+					     const_tree, enum tree_code *);

 /* Creation and deletion of loop and stmt info structs.  */
 extern loop_vec_info new_loop_vec_info (struct loop *loop);
diff -rup orig/egcc-SVN20070824/gcc/tree-vrp.c egcc-SVN20070824/gcc/tree-vrp.c
--- orig/egcc-SVN20070824/gcc/tree-vrp.c	2007-08-21 20:03:27.000000000 -0400
+++ egcc-SVN20070824/gcc/tree-vrp.c	2007-08-24 23:49:07.249061114 -0400
@@ -107,7 +107,7 @@ static int *vr_phi_edge_counts;
    TYPE_{MIN,MAX}_VALUE.  */

 static inline bool
-needs_overflow_infinity (tree type)
+needs_overflow_infinity (const_tree type)
 {
   return INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type);
 }
@@ -119,7 +119,7 @@ needs_overflow_infinity (tree type)
    VARYING.  */

 static inline bool
-supports_overflow_infinity (tree type)
+supports_overflow_infinity (const_tree type)
 {
 #ifdef ENABLE_CHECKING
   gcc_assert (needs_overflow_infinity (type));
@@ -169,7 +169,7 @@ positive_overflow_infinity (tree type)
 /* Return whether VAL is a negative overflow infinity.  */

 static inline bool
-is_negative_overflow_infinity (tree val)
+is_negative_overflow_infinity (const_tree val)
 {
   return (needs_overflow_infinity (TREE_TYPE (val))
 	  && CONSTANT_CLASS_P (val)
@@ -180,7 +180,7 @@ is_negative_overflow_infinity (tree val)
 /* Return whether VAL is a positive overflow infinity.  */

 static inline bool
-is_positive_overflow_infinity (tree val)
+is_positive_overflow_infinity (const_tree val)
 {
   return (needs_overflow_infinity (TREE_TYPE (val))
 	  && CONSTANT_CLASS_P (val)
@@ -191,7 +191,7 @@ is_positive_overflow_infinity (tree val)
 /* Return whether VAL is a positive or negative overflow infinity.  */

 static inline bool
-is_overflow_infinity (tree val)
+is_overflow_infinity (const_tree val)
 {
   return (needs_overflow_infinity (TREE_TYPE (val))
 	  && CONSTANT_CLASS_P (val)
@@ -229,7 +229,7 @@ avoid_overflow_infinity (tree val)
    to the integer constant with the same value in the type.  */

 static inline bool
-vrp_val_is_max (tree val)
+vrp_val_is_max (const_tree val)
 {
   tree type_max = TYPE_MAX_VALUE (TREE_TYPE (val));

@@ -242,7 +242,7 @@ vrp_val_is_max (tree val)
    will be true for a negative overflow infinity.  */

 static inline bool
-vrp_val_is_min (tree val)
+vrp_val_is_min (const_tree val)
 {
   tree type_min = TYPE_MIN_VALUE (TREE_TYPE (val));

@@ -256,7 +256,7 @@ vrp_val_is_min (tree val)
    current function signature.  */

 static bool
-nonnull_arg_p (tree arg)
+nonnull_arg_p (const_tree arg)
 {
   tree t, attrs, fntype;
   unsigned HOST_WIDE_INT arg_num;
@@ -462,7 +462,7 @@ set_value_range_to_undefined (value_rang
    return NULL.  Otherwise create an empty range if none existed for VAR.  */

 static value_range_t *
-get_value_range (tree var)
+get_value_range (const_tree var)
 {
   value_range_t *vr;
   tree sym;
@@ -504,7 +504,7 @@ get_value_range (tree var)
 /* Return true, if VAL1 and VAL2 are equal values for VRP purposes.  */

 static inline bool
-vrp_operand_equal_p (tree val1, tree val2)
+vrp_operand_equal_p (const_tree val1, const_tree val2)
 {
   if (val1 == val2)
     return true;
@@ -536,7 +536,7 @@ vrp_bitmap_equal_p (const_bitmap b1, con
    is the range object associated with another SSA name.  */

 static inline bool
-update_value_range (tree var, value_range_t *new_vr)
+update_value_range (const_tree var, value_range_t *new_vr)
 {
   value_range_t *old_vr;
   bool is_new;
@@ -562,7 +562,7 @@ update_value_range (tree var, value_rang
    point where equivalence processing can be turned on/off.  */

 static void
-add_equivalence (bitmap *equiv, tree var)
+add_equivalence (bitmap *equiv, const_tree var)
 {
   unsigned ver = SSA_NAME_VERSION (var);
   value_range_t *vr = vr_value[ver];
@@ -1044,7 +1044,7 @@ range_includes_zero_p (value_range_t *vr
    false otherwise or if no value range information is available.  */

 bool
-ssa_name_nonnegative_p (tree t)
+ssa_name_nonnegative_p (const_tree t)
 {
   value_range_t *vr = get_value_range (t);

@@ -1066,7 +1066,7 @@ ssa_name_nonnegative_p (tree t)
    false otherwise or if no value range information is available.  */

 bool
-ssa_name_nonzero_p (tree t)
+ssa_name_nonzero_p (const_tree t)
 {
   value_range_t *vr = get_value_range (t);

@@ -3252,7 +3252,7 @@ build_assert_expr_for (tree cond, tree v
    point values.  */

 static inline bool
-fp_predicate (tree expr)
+fp_predicate (const_tree expr)
 {
   return (COMPARISON_CLASS_P (expr)
 	  && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0))));
diff -rup orig/egcc-SVN20070824/gcc/tree.c egcc-SVN20070824/gcc/tree.c
--- orig/egcc-SVN20070824/gcc/tree.c	2007-08-23 12:12:21.000000000 -0400
+++ egcc-SVN20070824/gcc/tree.c	2007-08-24 23:49:07.257166170 -0400
@@ -6359,7 +6359,7 @@ get_type_static_bounds (const_tree type,
    variable defined in function FN.  */

 bool
-auto_var_in_fn_p (tree var, tree fn)
+auto_var_in_fn_p (const_tree var, const_tree fn)
 {
   return (DECL_P (var) && DECL_CONTEXT (var) == fn
 	  && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
@@ -8642,10 +8642,10 @@ walk_tree_without_duplicates_1 (tree *tp
    empty statements.  */

 bool
-empty_body_p (tree stmt)
+empty_body_p (const_tree stmt)
 {
-  tree_stmt_iterator i;
-  tree body;
+  const_tree_stmt_iterator i;
+  const_tree body;

   if (IS_EMPTY_STMT (stmt))
     return true;
@@ -8656,8 +8656,8 @@ empty_body_p (tree stmt)
   else
     return false;

-  for (i = tsi_start (body); !tsi_end_p (i); tsi_next (&i))
-    if (!empty_body_p (tsi_stmt (i)))
+  for (i = ctsi_start (body); !ctsi_end_p (i); ctsi_next (&i))
+    if (!empty_body_p (ctsi_stmt (i)))
       return false;

   return true;
diff -rup orig/egcc-SVN20070824/gcc/tree.h egcc-SVN20070824/gcc/tree.h
--- orig/egcc-SVN20070824/gcc/tree.h	2007-08-23 12:12:21.000000000 -0400
+++ egcc-SVN20070824/gcc/tree.h	2007-08-24 23:49:07.263077684 -0400
@@ -4606,11 +4606,11 @@ extern bool commutative_tree_code (enum
 extern tree upper_bound_in_type (tree, tree);
 extern tree lower_bound_in_type (tree, tree);
 extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
-extern bool empty_body_p (tree);
+extern bool empty_body_p (const_tree);
 extern tree call_expr_arg (tree, int);
 extern tree *call_expr_argp (tree, int);
 extern tree call_expr_arglist (tree);
-extern bool auto_var_in_fn_p (tree, tree);
+extern bool auto_var_in_fn_p (const_tree, const_tree);

 /* In stmt.c */

@@ -5142,8 +5142,8 @@ extern tree tree_mem_ref_addr (tree, tre
 extern void copy_mem_ref_info (tree, tree);

 /* In tree-vrp.c */
-extern bool ssa_name_nonzero_p (tree);
-extern bool ssa_name_nonnegative_p (tree);
+extern bool ssa_name_nonzero_p (const_tree);
+extern bool ssa_name_nonnegative_p (const_tree);

 /* In tree-object-size.c.  */
 extern void init_object_sizes (void);


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