From 1e60697fe1595df64ad679af3f8cc56400c7fe45 Mon Sep 17 00:00:00 2001 From: Daniel Franke Date: Mon, 2 Jun 2008 12:41:08 -0400 Subject: [PATCH] re PR fortran/36375 (ICE on -fpreprocessed) 2008-06-02 Daniel Franke 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 | 8 ++++++++ gcc/fortran/cpp.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a928c25b386..06fc54ce6a7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2008-06-02 Daniel Franke + + 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 * intrinsic.texi: Revert wrong commit. diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index 865e2efc79d..170f6cdcd63 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -524,6 +524,9 @@ gfc_cpp_init (void) { int i; + if (gfc_option.flag_preprocessed) + return; + cpp_change_file (cpp_in, LC_RENAME, _("")); 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); -- 2.30.2