diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4331df151689d711f60d766c11198b73210ccd05..1f48401e117fa325f4862fa67e75420a3edc869f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,26 @@
 2001-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+	* Makefile.in (ifcvt.o): Depend on toplev.h.
+
+	* c-semantics.c: Include expr.h.
+
+	* ifcvt.c: Include toplev.h.
+
+	* expr.h (rtx_equal_p): Delete prototype.
+
+	* rtl.h (exact_log2_wide, floor_log2_wide, permalloc,
+	protect_from_queue, gen_jump, gen_beq, gen_bge, gen_ble,
+	eliminate_constant_term, expand_complex_abs, find_single_use,
+	make_tree, init_expr_once, init_optabs, supports_one_only):
+	Likewise.
+	
+	* tree.h (exact_log2_wide, floor_log2_wide, expand_null_return,
+	rest_of_type_compilation, emit_queue, do_pending_stack_adjust,
+	expand_assignment, store_expr, emit_line_note_after,
+	emit_line_note_force, split_specs_attrs, label_rtx): Likewise.
+	
+	* toplev.h (exact_log2_wide, floor_log2_wide): Add prototype.
+
 	* sparc-protos.h: Delete redundant prototypes.
 
 2001-04-11  Vladimir Makarov  <vmakarov@toke.toronto.redhat.com>
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index fb7c9ae2cd533ca559e5b14c3422ef1225d0af9e..935c04f8038df739d81c187b756b2077ad5ccd88 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1567,7 +1567,7 @@ timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) flags.h intl.h
 regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
    resource.h $(OBSTACK_H) flags.h $(TM_P_H)
-ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
+ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) toplev.h \
    flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
    output.h $(TM_P_H)
 dependence.o : dependence.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 6f2ca2c9cfcfc0bb6e2edc0d24090e00712eb57f..c491335e1e86d961639795936588880f9f568fb1 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA.  */
 #include "flags.h"
 #include "ggc.h"
 #include "rtl.h"
+#include "expr.h"
 #include "output.h"
 #include "timevar.h"
 
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6a871d4d8280bf2252914c8ae6e1d78ca97719f5..6183bb8f06c25d7a7faa56c4c617c48d3044819f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* Make-lang.in (cp/semantics.o): Depend on $(EXPR_H).
+
+	* semantics.c: Include expr.h.
+
 2001-04-11  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* method.c (implicitly_declare_fn): Commonize code for copy ctor
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 58211935f3a3f15461f67dfb563bca1590f30e13..8309ea68e6c16ab777c07375f0ede80fbff19962 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -294,7 +294,7 @@ cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h
 cp/errfn.o: cp/errfn.c $(CXX_TREE_H) toplev.h
 cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H)
 cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
-  flags.h $(GGC_H) output.h $(RTL_H) $(TIMEVAR_H)
+  flags.h $(GGC_H) output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H)
 cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dump.h
 cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
   input.h params.h
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 4792b3423c7b009e0cc968e2f37524cd7f6e4b50..9295564cad462dc2d8223550c72ed73113846da9 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -34,6 +34,7 @@
 #include "flags.h"
 #include "ggc.h"
 #include "rtl.h"
+#include "expr.h"
 #include "output.h"
 #include "timevar.h"
 
diff --git a/gcc/expr.h b/gcc/expr.h
index 1f107d93012f7fc6c14d4d92f769f1533807d50b..27b11195bebef398e4cb0681b3100058e95a58bc 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -1168,9 +1168,6 @@ extern void set_mem_attributes PARAMS ((rtx, tree, int));
 /* Assemble the static constant template for function entry trampolines.  */
 extern rtx assemble_trampoline_template PARAMS ((void));
 
-/* Return 1 if two rtx's are equivalent in structure and elements.  */
-extern int rtx_equal_p PARAMS ((rtx, rtx));
-
 /* Given rtx, return new rtx whose address won't be affected by
    any side effects.  It has been copied to a new temporary reg.  */
 extern rtx stabilize PARAMS ((rtx));
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index b642643f3aec048d52360bd00fcd38c14d12ee2b..f40a656da34448f5607967c37d44ab85aebfc421 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -32,6 +32,7 @@
 #include "expr.h"
 #include "real.h"
 #include "output.h"
+#include "toplev.h"
 #include "tm_p.h"
 
 
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 6fa18d7d7da0b9eabf00227b732096aeb82c0857..6fed58b51c648bd9b054fe5e0ea81d09b6e00a2e 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* Make-lang.in (java/boehm.o): Depend on toplev.h.
+
+	* boehm.c: Include toplev.h.
+
 2001-04-06  Tom Tromey  <tromey@redhat.com>
 	    Alexandre Petit-Bianco  <apbianco@redhat.com>
 
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index f8a9b2b81ef5c05096824133d30d9baeb225f9ef..ca3653f2d67ace2743248981af908998ed1635c1 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -240,7 +240,7 @@ java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/jcf-dump.c \
 java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/gjavah.c \
   java/jcf-reader.c java/jcf.h java/javaop.h version.h
 java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(JAVA_TREE_H) \
-  java/parse.h
+  java/parse.h toplev.h
 java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h
 java/check-init.o: java/check-init.c $(CONFIG_H) \
   $(JAVA_TREE_H) $(SYSTEM_H) toplev.h
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index c76cad3475f866c9b3888463882cf6be5ea4281c..e92b4402b3803902fbbb0d2e3ca0eda555470b02 100644
--- a/gcc/java/boehm.c
+++ b/gcc/java/boehm.c
@@ -30,6 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "tree.h"
 #include "java-tree.h"
 #include "parse.h"
+#include "toplev.h"
 
 static void mark_reference_fields PARAMS ((tree,
 					   unsigned HOST_WIDE_INT *,
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 11da9c5dc48a6836653efd21d5623ba8d8add1fd..c1af43d38a85dd46a1830a35db1a0eec259d31d0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1132,17 +1132,6 @@ extern int generating_concat_p;
 
 /* Generally useful functions.  */
 
-/* The following functions accept a wide integer argument.  Rather than
-   having to cast on every function call, we use a macro instead, that is
-   defined here and in tree.h.  */
-
-#ifndef exact_log2
-#define exact_log2(N) exact_log2_wide ((unsigned HOST_WIDE_INT) (N))
-#define floor_log2(N) floor_log2_wide ((unsigned HOST_WIDE_INT) (N))
-#endif
-extern int exact_log2_wide		PARAMS ((unsigned HOST_WIDE_INT));
-extern int floor_log2_wide		PARAMS ((unsigned HOST_WIDE_INT));
-
 /* In expmed.c */
 extern int ceil_log2			PARAMS ((unsigned HOST_WIDE_INT));
 
@@ -1165,7 +1154,6 @@ extern rtx gen_rtx			PARAMS ((enum rtx_code,
 extern rtvec gen_rtvec			PARAMS ((int, ...));
 
 /* In other files */
-extern char *permalloc			PARAMS ((int));
 extern rtx rtx_alloc			PARAMS ((RTX_CODE));
 extern rtvec rtvec_alloc		PARAMS ((int));
 extern rtx copy_insn_1			PARAMS ((rtx));
@@ -1243,7 +1231,6 @@ extern rtx assign_stack_temp		PARAMS ((enum machine_mode,
 extern rtx assign_temp			PARAMS ((union tree_node *,
 					       int, int, int));
 /* In expr.c  */
-extern rtx protect_from_queue		PARAMS ((rtx, int));
 extern void emit_queue			PARAMS ((void));
 extern rtx emit_move_insn		PARAMS ((rtx, rtx));
 
@@ -1349,21 +1336,9 @@ extern rtx simplify_rtx			PARAMS ((rtx));
 /* In optabs.c  */
 extern rtx gen_move_insn		PARAMS ((rtx, rtx));
 
-extern rtx gen_jump			PARAMS ((rtx));
-extern rtx gen_beq			PARAMS ((rtx));
-extern rtx gen_bge			PARAMS ((rtx));
-extern rtx gen_ble			PARAMS ((rtx));
-
 /* In function.c  */
 extern rtx gen_mem_addressof		PARAMS ((rtx, union tree_node *));
 
-/* In explow.c  */
-extern rtx eliminate_constant_term	PARAMS ((rtx, rtx *));
-
-/* In optabs.c */
-extern rtx expand_complex_abs		PARAMS ((enum machine_mode, rtx, rtx,
-						 int));
-
 /* In regclass.c  */
 extern enum machine_mode choose_hard_reg_mode PARAMS ((unsigned int,
 						       unsigned int));
@@ -1645,11 +1620,9 @@ extern rtx gen_lowpart_SUBREG PARAMS ((enum machine_mode, rtx));
 #define INVALID_REGNUM			(~(unsigned int)0)
 
 extern rtx find_next_ref		PARAMS ((rtx, rtx));
-extern rtx *find_single_use		PARAMS ((rtx, rtx, rtx *));
 
 extern rtx output_constant_def		PARAMS ((union tree_node *, int));
 extern rtx immed_real_const		PARAMS ((union tree_node *));
-extern union tree_node *make_tree	PARAMS ((union tree_node *, rtx));
 
 /* Define a default value for STORE_FLAG_VALUE.  */
 
@@ -1853,7 +1826,6 @@ extern void emit_jump			PARAMS ((rtx));
 extern int preserve_subexpressions_p	PARAMS ((void));
 
 /* In expr.c */
-extern void init_expr_once		PARAMS ((void));
 extern void move_by_pieces		PARAMS ((rtx, rtx,
 						 unsigned HOST_WIDE_INT,
 						 unsigned int));
@@ -1915,9 +1887,6 @@ extern void combine_stack_adjustments	PARAMS ((void));
 extern void dbr_schedule		PARAMS ((rtx, FILE *));
 #endif
 
-/* In optabs.c */
-extern void init_optabs			PARAMS ((void));
-
 /* In local-alloc.c */
 #ifdef BUFSIZ
 extern void dump_local_alloc		PARAMS ((FILE *));
@@ -2000,7 +1969,6 @@ extern int set_dominates_use		PARAMS ((int, int, int, rtx, rtx));
 /* In varasm.c */
 extern void bss_section			PARAMS ((void));
 extern int in_data_section		PARAMS ((void));
-extern int supports_one_only		PARAMS ((void));
 extern void init_varasm_once		PARAMS ((void));
 
 /* In rtl.c */
diff --git a/gcc/toplev.h b/gcc/toplev.h
index bed92ae63a908dab3de385758af28ceb0a8434d8..edf7e0242e08551775aaf3e593a51ee21f770178 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -170,4 +170,14 @@ extern struct lang_hooks lang_hooks;
 extern void set_fast_math_flags         PARAMS ((void));
 extern void set_no_fast_math_flags      PARAMS ((void));
 
+/* The following functions accept a wide integer argument.  Rather
+   than having to cast on every function call, we use a macro instead.  */
+
+#ifndef exact_log2
+#define exact_log2(N) exact_log2_wide ((unsigned HOST_WIDE_INT) (N))
+#define floor_log2(N) floor_log2_wide ((unsigned HOST_WIDE_INT) (N))
+#endif
+extern int exact_log2_wide             PARAMS ((unsigned HOST_WIDE_INT));
+extern int floor_log2_wide             PARAMS ((unsigned HOST_WIDE_INT));
+
 #endif /* __GCC_TOPLEV_H */
diff --git a/gcc/tree.h b/gcc/tree.h
index f1470afb9a6430ad69d55358e6aec1c0bdb34d90..a394a31f396f45e5efeee30cf3c329ce885cfc10 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1907,17 +1907,6 @@ extern tree integer_types[itk_none];
 
 #define NULL_TREE (tree) NULL
 
-/* The following functions accept a wide integer argument.  Rather than
-   having to cast on every function call, we use a macro instead, that is
-   defined here and in rtl.h.  */
-
-#ifndef exact_log2
-#define exact_log2(N) exact_log2_wide ((unsigned HOST_WIDE_INT) (N))
-#define floor_log2(N) floor_log2_wide ((unsigned HOST_WIDE_INT) (N))
-#endif
-extern int exact_log2_wide             PARAMS ((unsigned HOST_WIDE_INT));
-extern int floor_log2_wide             PARAMS ((unsigned HOST_WIDE_INT));
-
 /* Approximate positive square root of a host double.  This is for
    statistical reports, not code generation.  */
 extern double approx_sqrt		PARAMS ((double));
@@ -2554,7 +2543,6 @@ extern int expand_exit_loop_if_false		PARAMS ((struct nesting *,
 						       tree));
 extern int expand_exit_something		PARAMS ((void));
 
-extern void expand_null_return			PARAMS ((void));
 extern void expand_return			PARAMS ((tree));
 extern int optimize_tail_recursion		PARAMS ((tree, struct rtx_def *));
 extern void expand_start_bindings_and_block     PARAMS ((int, tree));
@@ -2679,9 +2667,6 @@ extern tree gettags				PARAMS ((void));
 
 extern tree build_range_type PARAMS ((tree, tree, tree));
 
-/* Called after finishing a record, union or enumeral type.  */
-extern void rest_of_type_compilation PARAMS ((tree, int));
-
 /* In alias.c */
 extern void record_component_aliases		PARAMS ((tree));
 extern HOST_WIDE_INT get_alias_set		PARAMS ((tree));
@@ -2789,24 +2774,14 @@ extern void indent_to			PARAMS ((FILE *, int));
 #endif
 
 /* In expr.c */
-extern void emit_queue				PARAMS ((void));
 extern int apply_args_register_offset		PARAMS ((int));
 extern struct rtx_def *expand_builtin_return_addr
 	PARAMS ((enum built_in_function, int, struct rtx_def *));
-extern void do_pending_stack_adjust		PARAMS ((void));
-extern struct rtx_def *expand_assignment	PARAMS ((tree, tree, int,
-							 int));
-extern struct rtx_def *store_expr		PARAMS ((tree,
-							 struct rtx_def *,
-							int));
 extern void check_max_integer_computation_mode	PARAMS ((tree));
 
 /* In emit-rtl.c */
 extern void start_sequence_for_rtl_expr		PARAMS ((tree));
-extern struct rtx_def *emit_line_note_after	PARAMS ((const char *, int,
-							 struct rtx_def *));
 extern struct rtx_def *emit_line_note		PARAMS ((const char *, int));
-extern struct rtx_def *emit_line_note_force	PARAMS ((const char *, int));
 
 /* In calls.c */
 
@@ -2818,7 +2793,6 @@ extern int mark_addressable		PARAMS ((tree));
 extern void incomplete_type_error	PARAMS ((tree, tree));
 extern void print_lang_statistics	PARAMS ((void));
 extern tree truthvalue_conversion	PARAMS ((tree));
-extern void split_specs_attrs		PARAMS ((tree, tree *, tree *));
 #ifdef BUFSIZ
 extern void print_lang_decl		PARAMS ((FILE *, tree, int));
 extern void print_lang_type		PARAMS ((FILE *, tree, int));
@@ -2860,7 +2834,6 @@ extern int div_and_round_double		PARAMS ((enum tree_code, int,
 /* In stmt.c */
 extern void emit_nop			PARAMS ((void));
 extern void expand_computed_goto	PARAMS ((tree));
-extern struct rtx_def *label_rtx	PARAMS ((tree));
 extern void expand_asm_operands		PARAMS ((tree, tree, tree, tree, int,
 						 const char *, int));
 extern int any_pending_cleanups		PARAMS ((int));