From 2eb79bbbb3c1e5310d20501d3fa03de04cd392b0 Mon Sep 17 00:00:00 2001
From: Steven Bosscher <steven@gcc.gnu.org>
Date: Tue, 1 Jun 2010 22:00:56 +0000
Subject: [PATCH] gimplify.c: Do not include except.h and optabs.h.

	* gimplify.c: Do not include except.h and optabs.h.
	(gimplify_body): Do not initialize RTL profiling.
	* gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h,
	langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h.
	* gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h,
	output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and
	langhooks.h.

	* tree-pretty-print.h: Include pretty-print.h.
	* gimple-pretty-print.h: Include pretty-print.h.

	* tree-pretty-print.c: Do not include diagnostic.h.
	* tree-vrp.c: Likewise.
	* tree-tailcall.c: Likewise
	* tree-scalar-evolution.c: Likewise
	* tree-ssa-dse.c: Likewise
	* tree-chrec.c: Likewise
	* tree-ssa-sccvn.c: Likewise
	* tree-ssa-copyrename.c: Likewise
	* tree-nomudflap.c: Likewise
	* tree-call-cdce.c: Likewise
	* tree-stdarg.c: Likewise
	* tree-ssa-math-opts.c: Likewise
	* tree-nrv.c: Likewise
	* tree-ssa-sink.c: Likewise
	* tree-browser.c: Likewise
	* tree-ssa-loop-ivcanon.c: Likewise
	* tree-ssa-loop.c: Likewise
	* tree-parloops.c: Likewise
	* tree-ssa-address.c: Likewise
	* tree-ssa-ifcombine.c: Likewise
	* tree-if-conv.c: Likewise
	* tree-data-ref.c: Likewise
	* tree-affine.c: Likewise
	* tree-ssa-phiopt.c: Likewise
	* tree-ssa-coalesce.c: Likewise
	* tree-ssa-pre.c: Likewise
	* tree-ssa-live.c: Likewise
	* tree-predcom.c: Likewise
	* tree-ssa-forwprop.c: Likewise
	* tree-ssa-dce.c: Likewise
	* tree-ssa-ter.c: Likewise
	* tree-ssa-loop-prefetch.c: Likewise
	* tree-optimize.c: Likewise
	* tree-ssa-phiprop.c: Likewise
	* tree-object-size.c: Likewise
	* tree-outof-ssa.c: Likewise
	* tree-ssa-structalias.c: Likewise
	* tree-switch-conversion.c: Likewise
	* tree-ssa-reassoc.c: Likewise
	* tree-ssa-operands.c: Likewise
	* tree-vectorizer.c: Likewise
	* tree-vect-data-refs.c: Likewise
	* tree-vect-generic.c: Likewise
	* tree-vect-stmts.c: Likewise
	* tree-vect-patterns.c: Likewise
	* tree-vect-slp.c: Likewise
	* tree-vect-loop.c: Likewise
	* tree-ssa-loop-ivopts.c: Likewise
	* tree-ssa-loop-im.c: Likewise
	* tree-ssa-loop-niter.c: Likewise
	* tree-ssa-loop-unswitch.c: Likewise
	* tree-ssa-loop-manip.c: Likewise
	* tree-ssa-loop-ch.c: Likewise
	* tree-dump.c: Likewise
	* tree-complex.c: Likewise

	* tree-into-ssa.c: Do not include diagnostic.h and expr.h.
	* tree-ssa-uninit.c: Likewise
	* tree-ssa-threadupdate.c: Likewise
	* tree-ssa-uncprop.c: Likewise
	* tree-ssa-ccp.c: Likewise
	* tree-ssa-dom.c: Likewise
	* tree-ssa-propagate.c: Likewise
	* tree-ssa-alias.c: Likewise
	* tree-dfa.c: Likewise
	* tree-cfgcleanup.c: Likewise
	* tree-sra.c: Likewise
	* tree-ssa-copy.c: Likewise
	* tree-ssa.c: Likewise
	* tree-profile.c: Likewise
	* tree-cfg.c: Likewise
	* tree-ssa-threadedge.c: Likewise
	* tree-vect-loop-manip.c: Likewise

	* tree-inline.c: Do not include diagnostic.h and expr.h.
	Include rtl.h.
	(copy_decl_for_dup_finish): Do not use NULL_RTX.

	* tree-loop-linear.c: Do not include diagnostic.h, expr.h,
	and optabs.h.
	* tree-loop-distribution.c: Likewise.

From-SVN: r160125
---
 gcc/ChangeLog                | 95 ++++++++++++++++++++++++++++++++++++
 gcc/gimple-fold.c            | 10 ----
 gcc/gimple-low.c             |  8 ---
 gcc/gimple-pretty-print.h    |  3 ++
 gcc/gimplify.c               | 15 ++----
 gcc/tree-affine.c            |  1 -
 gcc/tree-browser.c           |  1 -
 gcc/tree-call-cdce.c         |  1 -
 gcc/tree-cfg.c               |  2 -
 gcc/tree-cfgcleanup.c        |  2 -
 gcc/tree-chrec.c             |  1 -
 gcc/tree-complex.c           |  1 -
 gcc/tree-data-ref.c          |  3 --
 gcc/tree-dfa.c               |  2 -
 gcc/tree-dump.c              |  1 -
 gcc/tree-if-conv.c           |  1 -
 gcc/tree-inline.c            |  6 +--
 gcc/tree-into-ssa.c          |  2 -
 gcc/tree-loop-distribution.c |  3 --
 gcc/tree-loop-linear.c       |  3 --
 gcc/tree-nested.c            |  2 +-
 gcc/tree-nomudflap.c         |  1 -
 gcc/tree-nrv.c               |  1 -
 gcc/tree-object-size.c       |  1 -
 gcc/tree-optimize.c          |  2 -
 gcc/tree-outof-ssa.c         |  6 ++-
 gcc/tree-parloops.c          |  1 -
 gcc/tree-predcom.c           |  1 -
 gcc/tree-pretty-print.c      |  1 -
 gcc/tree-pretty-print.h      |  2 +
 gcc/tree-profile.c           |  1 -
 gcc/tree-scalar-evolution.c  |  1 -
 gcc/tree-sra.c               |  2 -
 gcc/tree-ssa-address.c       |  1 -
 gcc/tree-ssa-alias.c         |  2 -
 gcc/tree-ssa-ccp.c           |  2 -
 gcc/tree-ssa-coalesce.c      |  1 -
 gcc/tree-ssa-copy.c          |  2 -
 gcc/tree-ssa-copyrename.c    |  1 -
 gcc/tree-ssa-dce.c           |  1 -
 gcc/tree-ssa-dom.c           |  2 -
 gcc/tree-ssa-dse.c           |  1 -
 gcc/tree-ssa-forwprop.c      |  1 -
 gcc/tree-ssa-ifcombine.c     |  1 -
 gcc/tree-ssa-live.c          |  1 -
 gcc/tree-ssa-loop-ch.c       |  1 -
 gcc/tree-ssa-loop-im.c       |  3 +-
 gcc/tree-ssa-loop-ivcanon.c  |  1 -
 gcc/tree-ssa-loop-ivopts.c   |  7 ++-
 gcc/tree-ssa-loop-manip.c    |  1 -
 gcc/tree-ssa-loop-niter.c    |  1 -
 gcc/tree-ssa-loop-prefetch.c |  7 ++-
 gcc/tree-ssa-loop-unswitch.c |  1 -
 gcc/tree-ssa-loop.c          |  1 -
 gcc/tree-ssa-math-opts.c     |  1 -
 gcc/tree-ssa-operands.c      |  1 -
 gcc/tree-ssa-phiopt.c        |  1 -
 gcc/tree-ssa-phiprop.c       |  1 -
 gcc/tree-ssa-pre.c           |  1 -
 gcc/tree-ssa-propagate.c     |  2 -
 gcc/tree-ssa-reassoc.c       |  1 -
 gcc/tree-ssa-sccvn.c         |  1 -
 gcc/tree-ssa-sink.c          |  1 -
 gcc/tree-ssa-structalias.c   |  1 -
 gcc/tree-ssa-ter.c           |  1 -
 gcc/tree-ssa-threadedge.c    |  2 -
 gcc/tree-ssa-threadupdate.c  |  2 -
 gcc/tree-ssa-uncprop.c       |  2 -
 gcc/tree-ssa-uninit.c        |  2 -
 gcc/tree-ssa.c               |  2 -
 gcc/tree-stdarg.c            |  1 -
 gcc/tree-switch-conversion.c |  1 -
 gcc/tree-tailcall.c          |  1 -
 gcc/tree-vect-data-refs.c    |  6 +--
 gcc/tree-vect-generic.c      |  8 ++-
 gcc/tree-vect-loop-manip.c   |  2 -
 gcc/tree-vect-loop.c         |  1 -
 gcc/tree-vect-patterns.c     |  1 -
 gcc/tree-vect-slp.c          |  1 -
 gcc/tree-vect-stmts.c        |  1 -
 gcc/tree-vectorizer.c        |  1 -
 gcc/tree-vrp.c               |  1 -
 82 files changed, 129 insertions(+), 140 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a87a41da66ab..ffe05035027e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,98 @@
+2010-06-01  Steven Bosscher  <steven@gcc.gnu.org>
+
+	* gimplify.c: Do not include except.h and optabs.h.
+	(gimplify_body): Do not initialize RTL profiling.
+	* gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h,
+	langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h.
+	* gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h,
+	output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and
+	langhooks.h.
+
+	* tree-pretty-print.h: Include pretty-print.h.
+	* gimple-pretty-print.h: Include pretty-print.h.
+
+	* tree-pretty-print.c: Do not include diagnostic.h.
+	* tree-vrp.c: Likewise.
+	* tree-tailcall.c: Likewise
+	* tree-scalar-evolution.c: Likewise
+	* tree-ssa-dse.c: Likewise
+	* tree-chrec.c: Likewise
+	* tree-ssa-sccvn.c: Likewise
+	* tree-ssa-copyrename.c: Likewise
+	* tree-nomudflap.c: Likewise
+	* tree-call-cdce.c: Likewise
+	* tree-stdarg.c: Likewise
+	* tree-ssa-math-opts.c: Likewise
+	* tree-nrv.c: Likewise
+	* tree-ssa-sink.c: Likewise
+	* tree-browser.c: Likewise
+	* tree-ssa-loop-ivcanon.c: Likewise
+	* tree-ssa-loop.c: Likewise
+	* tree-parloops.c: Likewise
+	* tree-ssa-address.c: Likewise
+	* tree-ssa-ifcombine.c: Likewise
+	* tree-if-conv.c: Likewise
+	* tree-data-ref.c: Likewise
+	* tree-affine.c: Likewise
+	* tree-ssa-phiopt.c: Likewise
+	* tree-ssa-coalesce.c: Likewise
+	* tree-ssa-pre.c: Likewise
+	* tree-ssa-live.c: Likewise
+	* tree-predcom.c: Likewise
+	* tree-ssa-forwprop.c: Likewise
+	* tree-ssa-dce.c: Likewise
+	* tree-ssa-ter.c: Likewise
+	* tree-ssa-loop-prefetch.c: Likewise
+	* tree-optimize.c: Likewise
+	* tree-ssa-phiprop.c: Likewise
+	* tree-object-size.c: Likewise
+	* tree-outof-ssa.c: Likewise
+	* tree-ssa-structalias.c: Likewise
+	* tree-switch-conversion.c: Likewise
+	* tree-ssa-reassoc.c: Likewise
+	* tree-ssa-operands.c: Likewise
+	* tree-vectorizer.c: Likewise
+	* tree-vect-data-refs.c: Likewise
+	* tree-vect-generic.c: Likewise
+	* tree-vect-stmts.c: Likewise
+	* tree-vect-patterns.c: Likewise
+	* tree-vect-slp.c: Likewise
+	* tree-vect-loop.c: Likewise
+	* tree-ssa-loop-ivopts.c: Likewise
+	* tree-ssa-loop-im.c: Likewise
+	* tree-ssa-loop-niter.c: Likewise
+	* tree-ssa-loop-unswitch.c: Likewise
+	* tree-ssa-loop-manip.c: Likewise
+	* tree-ssa-loop-ch.c: Likewise
+	* tree-dump.c: Likewise
+	* tree-complex.c: Likewise
+
+	* tree-into-ssa.c: Do not include diagnostic.h and expr.h.
+	* tree-ssa-uninit.c: Likewise
+	* tree-ssa-threadupdate.c: Likewise
+	* tree-ssa-uncprop.c: Likewise
+	* tree-ssa-ccp.c: Likewise
+	* tree-ssa-dom.c: Likewise
+	* tree-ssa-propagate.c: Likewise
+	* tree-ssa-alias.c: Likewise
+	* tree-dfa.c: Likewise
+	* tree-cfgcleanup.c: Likewise
+	* tree-sra.c: Likewise
+	* tree-ssa-copy.c: Likewise
+	* tree-ssa.c: Likewise
+	* tree-profile.c: Likewise
+	* tree-cfg.c: Likewise
+	* tree-ssa-threadedge.c: Likewise
+	* tree-vect-loop-manip.c: Likewise
+
+	* tree-inline.c: Do not include diagnostic.h and expr.h.
+	Include rtl.h.
+	(copy_decl_for_dup_finish): Do not use NULL_RTX.
+
+	* tree-loop-linear.c: Do not include diagnostic.h, expr.h,
+	and optabs.h.
+	* tree-loop-distribution.c: Likewise.
+
 2010-06-01  Jan Hubicka  <jh@suse.cz>
 
 	* ipa-pure-const.c (local_pure_const): Do NORETURN discovery.
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index e74f52457d83..2f64beb6733e 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -24,21 +24,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "flags.h"
-#include "rtl.h"
-#include "tm_p.h"
-#include "ggc.h"
-#include "basic-block.h"
-#include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
-#include "timevar.h"
 #include "tree-dump.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
 #include "tree-ssa-propagate.h"
-#include "value-prof.h"
-#include "langhooks.h"
 #include "target.h"
 
 
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index ae5a9fdfcf5f..0823b890232a 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -24,20 +24,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "rtl.h"
 #include "gimple.h"
 #include "tree-iterator.h"
 #include "tree-inline.h"
-#include "diagnostic.h"
-#include "langhooks.h"
-#include "langhooks-def.h"
 #include "tree-flow.h"
-#include "timevar.h"
-#include "except.h"
-#include "hashtab.h"
 #include "flags.h"
 #include "function.h"
-#include "expr.h"
 #include "toplev.h"
 #include "tree-pass.h"
 
diff --git a/gcc/gimple-pretty-print.h b/gcc/gimple-pretty-print.h
index 4d2fd4bb942f..b7c525dbe7e1 100644
--- a/gcc/gimple-pretty-print.h
+++ b/gcc/gimple-pretty-print.h
@@ -22,6 +22,9 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_GIMPLE_PRETTY_PRINT_H
 #define GCC_GIMPLE_PRETTY_PRINT_H
 
+#include "pretty-print.h"
+#include "tree-pretty-print.h"
+
 /* In gimple-pretty-print.c  */
 extern void debug_gimple_stmt (gimple);
 extern void debug_gimple_seq (gimple_seq);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 855098f5af53..fd1f05f3d98b 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -26,33 +26,30 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "rtl.h"
 #include "gimple.h"
 #include "tree-iterator.h"
 #include "tree-inline.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "langhooks.h"
-#include "langhooks-def.h"
 #include "tree-flow.h"
 #include "cgraph.h"
 #include "timevar.h"
-#include "except.h"
 #include "hashtab.h"
 #include "flags.h"
 #include "function.h"
 #include "output.h"
-#include "expr.h"
 #include "ggc.h"
 #include "toplev.h"
 #include "target.h"
-#include "optabs.h"
 #include "pointer-set.h"
 #include "splay-tree.h"
 #include "vec.h"
 #include "gimple.h"
 #include "tree-pass.h"
 
+#include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name.  */
+#include "expr.h"		/* FIXME: for can_move_by_pieces
+				   and STACK_CHECK_MAX_VAR_SIZE.  */
 
 enum gimplify_omp_var_data
 {
@@ -1906,7 +1903,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
 	      tree copy = copy_node (decl), block;
 
 	      lang_hooks.dup_lang_specific_decl (copy);
-	      SET_DECL_RTL (copy, NULL_RTX);
+	      SET_DECL_RTL (copy, 0);
 	      TREE_USED (copy) = 1;
 	      block = DECL_INITIAL (current_function_decl);
 	      TREE_CHAIN (copy) = BLOCK_VARS (block);
@@ -7601,10 +7598,6 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms)
 
   timevar_push (TV_TREE_GIMPLIFY);
 
-  /* Initialize for optimize_insn_for_s{ize,peed}_p possibly called during
-     gimplification.  */
-  default_rtl_profile ();
-
   gcc_assert (gimplify_ctxp == NULL);
   push_gimplify_context (&gctx);
 
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 898e5c125522..4d63de381c4a 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-dump.h"
 #include "pointer-set.h"
diff --git a/gcc/tree-browser.c b/gcc/tree-browser.c
index 0180d3ae4f7c..a7c80c991ec5 100644
--- a/gcc/tree-browser.c
+++ b/gcc/tree-browser.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "tree-inline.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "hashtab.h"
 
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 6517742ca709..7f0a3e223e9b 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "basic-block.h"
 #include "tree.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "gimple.h"
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index a76a254cbd20..7db5192a2ea8 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -29,10 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "output.h"
 #include "flags.h"
 #include "function.h"
-#include "expr.h"
 #include "ggc.h"
 #include "langhooks.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 10fc7aceb644..fc2141f48c17 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -29,10 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "flags.h"
 #include "function.h"
-#include "expr.h"
 #include "ggc.h"
 #include "langhooks.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "timevar.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index b0cc8b22b017..24e1944da69f 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -30,7 +30,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "ggc.h"
 #include "tree.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "cfgloop.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index f1ef1770939a..c491ac8173c7 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "tree-pass.h"
 #include "tree-ssa-propagate.h"
-#include "diagnostic.h"
 
 
 /* For each complex ssa name, a lattice value.  We're interested in finding
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 41dae8deb1ec..c41cf51f775e 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -81,10 +81,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "flags.h"
 #include "tree.h"
-
-/* These RTL headers are needed for basic-block.h.  */
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 66b9090ed6af..ad03cd235c66 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -30,12 +30,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "output.h"
 #include "timevar.h"
-#include "expr.h"
 #include "ggc.h"
 #include "langhooks.h"
 #include "flags.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-dump.h"
 #include "gimple.h"
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 99e9c79fcde7..539a11dfe350 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "splay-tree.h"
-#include "diagnostic.h"
 #include "toplev.h"
 #include "tree-dump.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 268c171baa67..f64623dae7d7 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -89,7 +89,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "timevar.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index fce6ae54a6ba..696cb00fbfd3 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "tree.h"
 #include "tree-inline.h"
-#include "expr.h"
 #include "flags.h"
 #include "params.h"
 #include "input.h"
@@ -41,7 +40,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-flow.h"
 #include "function.h"
 #include "tree-flow.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "except.h"
 #include "debug.h"
@@ -52,6 +50,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "integrate.h"
 
+#include "rtl.h"	/* FIXME: For asm_str_count.  */
+
 /* I'm not real happy about this, but we need to handle gimple and
    non-gimple trees.  */
 #include "gimple.h"
@@ -4697,7 +4697,7 @@ copy_decl_for_dup_finish (copy_body_data *id, tree decl, tree copy)
   /* The new variable/label has no RTL, yet.  */
   if (CODE_CONTAINS_STRUCT (TREE_CODE (copy), TS_DECL_WRTL)
       && !TREE_STATIC (copy) && !DECL_EXTERNAL (copy))
-    SET_DECL_RTL (copy, NULL_RTX);
+    SET_DECL_RTL (copy, 0);
 
   /* These args would always appear unused, if not for this.  */
   TREE_USED (copy) = 1;
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 5885addde261..a095ffd634dc 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -29,9 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 51c66778773d..5379709261ed 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -48,13 +48,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
 #include "cfgloop.h"
-#include "expr.h"
-#include "optabs.h"
 #include "tree-chrec.h"
 #include "tree-data-ref.h"
 #include "tree-scalar-evolution.h"
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index b771852c609c..03759dec9670 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -26,14 +26,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "obstack.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
 #include "cfgloop.h"
-#include "expr.h"
-#include "optabs.h"
 #include "tree-chrec.h"
 #include "tree-data-ref.h"
 #include "tree-scalar-evolution.h"
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index cd1d770b3357..cd1530740959 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -31,7 +31,7 @@
 #include "tree-iterator.h"
 #include "tree-flow.h"
 #include "cgraph.h"
-#include "expr.h"
+#include "expr.h"	/* FIXME: For STACK_SAVEAREA_MODE and SAVE_NONLOCAL.  */
 #include "langhooks.h"
 #include "pointer-set.h"
 
diff --git a/gcc/tree-nomudflap.c b/gcc/tree-nomudflap.c
index c035f76b5635..4d54efdf0896 100644
--- a/gcc/tree-nomudflap.c
+++ b/gcc/tree-nomudflap.c
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "tree-inline.h"
 #include "gimple.h"
-#include "diagnostic.h"
 #include "hashtab.h"
 #include "output.h"
 #include "langhooks.h"
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 06b13511e25d..31de9ba7753a 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "function.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "timevar.h"
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 35b3c44707e5..5c7d6f599c87 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "toplev.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 2631e14cce4e..ef60cde53bff 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -27,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
-#include "basic-block.h"
 #include "flags.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 26395710eb86..188cf0c8d7a2 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "ggc.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
@@ -35,9 +34,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-dump.h"
 #include "tree-pass.h"
 #include "toplev.h"
-#include "expr.h"
 #include "ssaexpand.h"
 
+/* FIXME: A lot of code here deals with expanding to RTL.  All that code
+   should be in cfgexpand.c.  */
+#include "expr.h"
+
 
 DEF_VEC_I(source_location);
 DEF_VEC_ALLOC_I(source_location,heap);
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index f38ae17d89a3..a17655ed699f 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-flow.h"
 #include "cfgloop.h"
 #include "tree-data-ref.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index dd7b6e2cdde3..de147e7ec962 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -198,7 +198,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-scalar-evolution.h"
 #include "tree-chrec.h"
 #include "params.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index ec10c144a5fa..bbdb38de10db 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "hashtab.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-pretty-print.h b/gcc/tree-pretty-print.h
index ef4cd27f8b56..8346dc4e48fc 100644
--- a/gcc/tree-pretty-print.h
+++ b/gcc/tree-pretty-print.h
@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_TREE_PRETTY_PRINT_H
 #define GCC_TREE_PRETTY_PRINT_H
 
+#include "pretty-print.h"
+
 #define pp_tree_identifier(PP, T)                      \
   pp_base_tree_identifier (pp_base (PP), T)
 
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 2d3ec1228584..ca15001fead2 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "flags.h"
 #include "regs.h"
-#include "expr.h"
 #include "function.h"
 #include "basic-block.h"
 #include "toplev.h"
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index d50eac983394..bf564d8dab53 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -261,7 +261,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index ae038f9a4410..702187c355d6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -77,12 +77,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "alloc-pool.h"
 #include "tm.h"
 #include "tree.h"
-#include "expr.h"
 #include "gimple.h"
 #include "cgraph.h"
 #include "tree-flow.h"
 #include "ipa-prop.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "statistics.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index f22b07d2ad24..3abfffe25ec8 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index e510358a49bd..d3890c5b57c5 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -27,12 +27,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "expr.h"
 #include "ggc.h"
 #include "langhooks.h"
 #include "flags.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-dump.h"
 #include "gimple.h"
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 3a2b51c72c59..44e284f68968 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -194,9 +194,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index 6c8436055733..2cdbceb2d3ae 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "flags.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "bitmap.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index afa9acef335c..7a4c0995514e 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -27,9 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index c236de34d962..41d43a6179cd 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "basic-block.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "bitmap.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 59ccc408e9cf..ae44ef189a63 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -49,7 +49,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 
 #include "tree.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "basic-block.h"
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 761593b4271a..25eb306369da 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -29,9 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "cfgloop.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 858cd5e4203c..be440c9b6570 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index f72950678019..eb6c831f7c8e 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 8b8e0ddc7962..a20f70404036 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index a3112959217c..ca1b985bb8e7 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 48799d7a6741..b81c19676813 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index eb15382e2a11..ce8bc34ebbac 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -26,9 +26,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
-#include "gimple-pretty-print.h"
 #include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 12383d7b42eb..0599a3683ea9 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -40,7 +40,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "tm_p.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index bda640f3e0ea..094e9cc8fe2c 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -70,14 +70,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
 #include "cfgloop.h"
-#include "expr.h"
 #include "tree-pass.h"
 #include "ggc.h"
 #include "insn-config.h"
@@ -92,6 +90,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-affine.h"
 #include "target.h"
 
+/* FIXME: Expressions are expanded to RTL in this pass to determine the
+   cost of different addressing modes.  This should be moved to a TBD
+   interface between the GIMPLE and RTL worlds.  */
+#include "expr.h"
+
 /* The infinite cost.  */
 #define INFTY 10000000
 
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 060ee2616018..219c71b9a964 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index d1c2e4cbb405..279718ee5e4a 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "intl.h"
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index d63ede1bbe98..9ccf72e18b2c 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -25,13 +25,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
 #include "cfgloop.h"
-#include "expr.h"
 #include "tree-pass.h"
 #include "insn-config.h"
 #include "recog.h"
@@ -43,6 +41,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "tree-inline.h"
 #include "tree-data-ref.h"
+
+
+/* FIXME: Needed for optabs, but this should all be moved to a TBD interface
+   between the GIMPLE and RTL worlds.  */
+#include "expr.h"
 #include "optabs.h"
 
 /* This pass inserts prefetch instructions to optimize cache usage during
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index d0751e81a385..6bc40af263ca 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "timevar.h"
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 1ecad36b109b..344cfa8acbef 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index f89910b82e54..9e67ea924d3c 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -97,7 +97,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "alloc-pool.h"
 #include "basic-block.h"
 #include "target.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 
 /* FIXME: RTL headers have to be included here for optabs.  */
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index f8224968fe4c..68be8fae8f48 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "flags.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index d40aeb2275c1..53ab31a15df3 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index a7bb01195efe..dc1cb28f7c34 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index ea4be543c45d..3d186fd70fac 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index d7243e982267..879e0db10eab 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -28,9 +28,7 @@
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "timevar.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index add41f882a20..0911c56a9bd8 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 8dba41b51c99..240885570546 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 40d3a2972f47..ac31781e198f 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index d70b36c3498f..0c5b0d3842d4 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -32,7 +32,6 @@
 #include "tree.h"
 #include "tree-flow.h"
 #include "tree-inline.h"
-#include "diagnostic.h"
 #include "toplev.h"
 #include "gimple.h"
 #include "hashtab.h"
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index a998db85c5f6..2f5b8305f744 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 631d97b8bfaa..0113d3ae8bd6 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -28,9 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "cfgloop.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "timevar.h"
 #include "tree-dump.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 2eae88c08404..4621eec868f4 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -27,9 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index c98f63ff9d5c..30aa4c7755d5 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -27,9 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "timevar.h"
 #include "tree-dump.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index 5487cc06b960..6d58f5b16312 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -29,9 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
 #include "pointer-set.h"
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index d07c61d04680..ec9c50ceb774 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -30,9 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "basic-block.h"
 #include "output.h"
-#include "expr.h"
 #include "function.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 8401747a0206..3bfbfc2dc196 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "function.h"
 #include "langhooks.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "target.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index cf3202ca9051..ed8b5ce5c0cc 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -93,7 +93,6 @@ eight) times the number of the actual switch branches. */
 #include "output.h"
 #include "input.h"
 #include "tree-pass.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-dump.h"
 #include "timevar.h"
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index e67f5805d271..5a6bd23ea427 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "except.h"
 #include "tree-pass.h"
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 76a5c21e2555..f2a1fc4f6803 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -28,19 +28,19 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "target.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "cfgloop.h"
-#include "expr.h"
-#include "optabs.h"
 #include "tree-chrec.h"
 #include "tree-scalar-evolution.h"
 #include "tree-vectorizer.h"
 #include "toplev.h"
 
+/* Need to include rtl.h, expr.h, etc. for optabs.  */
+#include "expr.h"
+#include "optabs.h"
 
 /* Return the smallest scalar part of STMT.
    This is used to determine the vectype of the stmt. We generally set the
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 25bda423f1ba..8b8a481992b9 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -23,11 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "tm.h"
-#include "expr.h"
-#include "insn-codes.h"
-#include "diagnostic.h"
-#include "optabs.h"
-#include "machmode.h"
 #include "langhooks.h"
 #include "tree-flow.h"
 #include "gimple.h"
@@ -36,6 +31,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "ggc.h"
 
+/* Need to include rtl.h, expr.h, etc. for optabs.  */
+#include "expr.h"
+#include "optabs.h"
 
 /* Build a constant of type TYPE, made of VALUE's bits replicated
    every TYPE_SIZE (INNER_TYPE) bits to fit TYPE's precision.  */
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 8289b363e76c..f8922a2308a6 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -27,14 +27,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "cfgloop.h"
 #include "cfglayout.h"
-#include "expr.h"
 #include "toplev.h"
 #include "tree-scalar-evolution.h"
 #include "tree-vectorizer.h"
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 465a95cbf121..a6b331a5d07b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "tree.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 987c267b7e33..eb97395620ef 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "target.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index f1b6355025f3..6870fca0c454 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "target.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 71f6e852ad72..7ad0988450be 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "target.h"
 #include "basic-block.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "tree-flow.h"
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index b44926868215..d4857e06cd6b 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -61,7 +61,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "ggc.h"
 #include "tree.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 2bb90b271719..f0e9ce64d64e 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pass.h"
 #include "tree-dump.h"
 #include "timevar.h"
-#include "diagnostic.h"
 #include "tree-pretty-print.h"
 #include "gimple-pretty-print.h"
 #include "toplev.h"
-- 
GitLab