re PR fortran/36375 (ICE on -fpreprocessed)
authorDaniel Franke <franke.daniel@gmail.com>
Mon, 2 Jun 2008 16:41:08 +0000 (12:41 -0400)
committerDaniel Franke <dfranke@gcc.gnu.org>
Mon, 2 Jun 2008 16:41:08 +0000 (12:41 -0400)
2008-06-02  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/36375
        PR fortran/36377
        * cpp.c (gfc_cpp_init): Do not initialize builtins if
        processing already preprocessed input.
        (gfc_cpp_preprocess): Finalize output with newline.

From-SVN: r136283

gcc/fortran/ChangeLog
gcc/fortran/cpp.c

index a928c25b386ac0688789ffbc349d1fa841f8e6b3..06fc54ce6a72898e1690d1fda20e7d09b01796d9 100644 (file)
@@ -1,3 +1,11 @@
+2008-06-02  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/36375
+       PR fortran/36377
+       * cpp.c (gfc_cpp_init): Do not initialize builtins if
+       processing already preprocessed input.
+       (gfc_cpp_preprocess): Finalize output with newline.
+
 2008-05-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        * intrinsic.texi: Revert wrong commit.
index 865e2efc79d2d0b6080a264551b508f5be598549..170f6cdcd63391d90d57fdc94efc00067772de4e 100644 (file)
@@ -524,6 +524,9 @@ gfc_cpp_init (void)
 {
   int i;
 
+  if (gfc_option.flag_preprocessed)
+    return;
+
   cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
   if (!gfc_cpp_option.no_predefined)
     cpp_define_builtins (cpp_in);
@@ -574,6 +577,8 @@ gfc_cpp_preprocess (const char *source_file)
       cpp_forall_identifiers (cpp_in, dump_macro, NULL);
     }
 
+  putc ('\n', print.outf);
+
   if (!gfc_cpp_preprocess_only ()
       || (gfc_cpp_preprocess_only () && gfc_cpp_option.output_filename))
     fclose (print.outf);