diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index e6ba144a012f2a04c64ad518e307b2311ebc50cf..4127aaefb6d5daac47095f1f1fde67bb03664175 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -282,6 +282,10 @@
 #include <fstream>  // Before cobol-system because it uses poisoned functions
 #include "cobol-system.h"
 #include "cdfval.h"
+#define USE_LOCATION_DUMP
+#include "genapi.h"
+#include "io.h"
+#include "ec.h"
 #include "parse_ante.h"
 %}
 
diff --git a/gcc/cobol/parse_ante.h b/gcc/cobol/parse_ante.h
index 9dc6fb01cf556dcb79c6537d781907b0b0eed85c..fec97c23464f38ce33bedc1a8f8233b7091b4e6a 100644
--- a/gcc/cobol/parse_ante.h
+++ b/gcc/cobol/parse_ante.h
@@ -28,12 +28,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define USE_LOCATION_DUMP
-
-#include "genapi.h"
-#include "io.h"
-#include "ec.h"
-
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>