diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0d43b6c63e6c0bc0e05f6fcb84745aa5faf1d346..7914454aa09496fddf5d9982faf7d8fdb28658cd 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-06  Tobias Burnus  <burnus@net-b.de>
+
+	* trans-decl.c: Include diagnostic-core.h besides toplev.h.
+	* trans-intrinsic.c: Ditto.
+	* trans-types.c: Ditto.
+	* convert.c: Include diagnostic-core.h instead of toplev.h.
+	* options.c: Ditto.
+	* trans-array.c: Ditto.
+	* trans-const.c: Ditto.
+	* trans-expr.c: Ditto.
+	* trans-io.c: Ditto.
+	* trans-openmp.c: Ditto.
+	* trans.c: Ditto.
+
 2010-07-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR fortran/PR44693
diff --git a/gcc/fortran/convert.c b/gcc/fortran/convert.c
index f69ea2386ef2f20e327e37dabff33298523bfc34..50e3a6a10f1d41b45e7c6f35cfb4a26d3894d9eb 100644
--- a/gcc/fortran/convert.c
+++ b/gcc/fortran/convert.c
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "flags.h"
 #include "convert.h"
-#include "toplev.h"	/* For error.  */
+#include "diagnostic-core.h"	/* For error.  */
 #include "gfortran.h"
 #include "trans.h"
 
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index af537a1e70ebe63fba76a4001de320c5002fbd17..d5c6c3caf90cc9ed2afbd0bdd896917c94ab8472 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gfortran.h"
 #include "target.h"
 #include "cpp.h"
-#include "toplev.h"	/* For sorry.  */
+#include "diagnostic-core.h"	/* For sorry.  */
 #include "tm.h"
 
 gfc_option_t gfc_option;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 7eb8e755785ac9daccea5efd86b1c0fde52da121..bc268357c9b38143020a22d5333bf8e870996d58 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -80,7 +80,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
-#include "toplev.h"	/* For internal_error/fatal_error.  */
+#include "diagnostic-core.h"	/* For internal_error/fatal_error.  */
 #include "flags.h"
 #include "gfortran.h"
 #include "constructor.h"
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 6d4f222ede6d7450f86477e3b82f0b8a9a7afed2..8cd4fda6d8df32bc5ee4ad9f359707076894b63e 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "realmpfr.h"
-#include "toplev.h"	/* For fatal_error.  */
+#include "diagnostic-core.h"	/* For fatal_error.  */
 #include "double-int.h"
 #include "gfortran.h"
 #include "trans.h"
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 1c7226c41e60773ced0ed712d55941e5d7830489..1331148dddbb9066afb390e64456a574411fd2fc 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -29,7 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-dump.h"
 #include "gimple.h"	/* For create_tmp_var_raw.  */
 #include "ggc.h"
-#include "toplev.h"	/* For announce_function/internal_error.  */
+#include "diagnostic-core.h"	/* For internal_error.  */
+#include "toplev.h"	/* For announce_function.  */
 #include "output.h"	/* For decl_default_tls_model.  */
 #include "target.h"
 #include "function.h"
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 1a7a4a1e4e2e69bd133eec8cde8b6c28d05a024c..ea8b8920279624bfac7c34ff93cb061e6ce35309 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
-#include "toplev.h"	/* For fatal_error.  */
+#include "diagnostic-core.h"	/* For fatal_error.  */
 #include "langhooks.h"
 #include "flags.h"
 #include "gfortran.h"
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 7f583dabe4461487e053ce0409a1ddabec244d1b..0b737b0e42acf2bb5a58608ccaac8ce6c8cab503 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -28,7 +28,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"		/* For UNITS_PER_WORD.  */
 #include "tree.h"
 #include "ggc.h"
-#include "toplev.h"	/* For rest_of_decl_compilation/internal_error.  */
+#include "diagnostic-core.h"	/* For internal_error.  */
+#include "toplev.h"	/* For rest_of_decl_compilation.  */
 #include "flags.h"
 #include "gfortran.h"
 #include "arith.h"
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 9926d2fb8a1dcfaca168dc15027515d959335bfa..2624bb294cec3b8419962c2a0b6060545559908e 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "ggc.h"
-#include "toplev.h"	/* For internal_error.  */
+#include "diagnostic-core.h"	/* For internal_error.  */
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 7a7d33088d7da610940988164d37e522a71a1335..4a7f70e7b6e5d9b7db696bf8de3b142b0086ea3c 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"	/* For create_tmp_var_raw.  */
-#include "toplev.h"	/* For internal_error.  */
+#include "diagnostic-core.h"	/* For internal_error.  */
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 6f71da8104bf8594aba734f62dbbc46ee952eca0..cfc6ab6ec8554fc814325e9477b56fc8a75f1f7c 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -30,7 +30,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"	/* For iso-c-bindings.def.  */
 #include "target.h"
 #include "ggc.h"
-#include "toplev.h"	/* For rest_of_decl_compilation/fatal_error.  */
+#include "diagnostic-core.h"  /* For fatal_error.  */
+#include "toplev.h"	/* For rest_of_decl_compilation.  */
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-types.h"
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 43b69d5a2b087b1ca7b0f4db33ef5bd4776f1f03..f97e7391b22add045ba793a3ed95f3903666a527 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple.h"	/* For create_tmp_var_raw.  */
 #include "tree-iterator.h"
-#include "toplev.h"	/* For internal_error.  */
+#include "diagnostic-core.h"  /* For internal_error.  */
 #include "defaults.h"
 #include "flags.h"
 #include "gfortran.h"