Manuel López-Ibáñez wrote:
OK, this is then the final patch. Bootstrapped and regression tested
on x86_64-linux-gnu.
OK to commit?

 void
 gfc_buffer_error (bool flag)
 {
   buffered_p = flag;
-  pp_warning_buffer.flush_p = !flag;
+  buffered_p = flag;
 }

Now there are two "buffered_p" …

Otherwise, it looks good to me. Thanks!

Tobias

gcc/ChangeLog:

2014-12-07  Manuel López-Ibáñez  <m...@gcc.gnu.org>

     PR fortran/44054
     * diagnostic.c (diagnostic_action_after_output): Make it extern.
     Take diagnostic_t argument instead of diagnostic_info.
     (diagnostic_report_diagnostic): Update call according to the above.
     (error_recursion): Likewise.
     * diagnostic.h (diagnostic_action_after_output): Declare.
     * pretty-print.c (pp_formatted_text_data): Delete.
     (pp_append_r): Call output_buffer_append_r.
     (pp_formatted_text): Call output_buffer_formatted_text.
     (pp_last_position_in_text): Call output_buffer_last_position_in_text.
     * pretty-print.h (output_buffer_formatted_text): New.
     (output_buffer_append_r): New.
     (output_buffer_last_position_in_text): New

gcc/testsuite/ChangeLog:

2014-12-07  Manuel López-Ibáñez  <m...@gcc.gnu.org>

         * gfortran.dg/do_iterator.f90: Remove bogus dg-warning.

gcc/fortran/ChangeLog:

2014-12-07  Manuel López-Ibáñez  <m...@gcc.gnu.org>

     PR fortran/44054
     * error.c (pp_error_buffer): New static variable.
     (gfc_output_buffer_empty_p): New.
     (gfc_error_init_1): Call gfc_buffer_error.
     (gfc_buffer_error): Do not use pp_warning_buffer.flush_p as the
     buffered_p flag.
     (gfc_clear_warning): Likewise.
     (gfc_warning_check): Call gfc_clear_warning. Only check the new
     pp_warning_buffer if the old warning_buffer was empty.
     (gfc_error_1): Renamed from gfc_error.
     (gfc_error): New.
     (gfc_clear_error): Clear also pp_error_buffer.
     (gfc_error_flag_test): Check also pp_error_buffer.
     (gfc_error_check): Likewise. Only check the new pp_error_buffer
     if the old error_buffer was empty.
     (gfc_move_output_buffer_from_to): New.
     (gfc_push_error): Use it here. Take also an output_buffer as argument.
     (gfc_pop_error): Likewise.
     (gfc_free_error): Likewise.
     (gfc_diagnostics_init): Init pp_error_buffer. Set
     flush_p to false for both pp_warning_buffer and pp_error_buffer.

     * Update gfc_push_error, gfc_pop_error and gfc_free_error calls
     according to the above changes.
     * Use gfc_error_1 for all gfc_error calls that use multiple
     locations.
     * Use %qs instead of '%s' for many gfc_error calls.

Reply via email to