+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * cfg.c (debug_bb): Do not set TDF_BLOCKS.
+       * cfghooks.c (dump_bb): Honor ~TDF_BLOCKS.
+       * pretty-print.c (pp_base_flush): Do not add a newline, and do not
+       clear pp_needs_newline.
+       * pretty-print.h (pp_newline_and_flush): New macro with the behavior
+       of pp_base_flush before the above change.
+       * langhooks.c (lhd_print_error_function): Use pp_newline_and_flush
+       instead of pp_flush.
+       * diagnostic.c (diagnostic_finish): Likewise.
+       (diagnostic_report_diagnostic): Likewise.
+       (verbatim): Likewise.
+       (error_recursion): Likewise.
+       * tree-pretty-print.c (print_generic_stmt): Likewise.
+       (print_generic_stmt_indented): LIkewise.
+       * gimple-pretty-print.c (print_gimple_stmt): Likewise.
+       (print_gimple_seq): Likewise.
+       (gimple_dump_bb_buff): Likewise.
+
 2012-08-07  Uros Bizjak  <ubizjak@gmail.com>
 
        PR debug/54177
 
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * c-pretty-print.c (pp_c_function_definition): Use pp_newline_and_flush
+       instead of separate pp_newline and pp_flush.
+       (print_c_tree): Likewise.
+
 2012-07-26  Richard Henderson  <rth@redhat.com>
 
        * c-common.c (handle_hot_attribute): Allow labels.
 
   pp_declarator (pp, t);
   pp_needs_newline (pp) = true;
   pp_statement (pp, DECL_SAVED_TREE (t));
-  pp_newline (pp);
-  pp_flush (pp);
+  pp_newline_and_flush (pp);
 }
 
 \f
 
   pp_statement (pp, t);
 
-  pp_newline (pp);
-  pp_flush (pp);
+  pp_newline_and_flush (pp);
 }
 
 /* Print the tree T in full, on stderr.  */
 
 DEBUG_FUNCTION void
 debug_bb (basic_block bb)
 {
-  dump_bb (stderr, bb, 0, dump_flags | TDF_BLOCKS);
+  dump_bb (stderr, bb, 0, dump_flags);
 }
 
 DEBUG_FUNCTION basic_block
 
 void
 dump_bb (FILE *outf, basic_block bb, int indent, int flags)
 {
-  dump_bb_info (outf, bb, indent, flags, true, false);
+  if (flags & TDF_BLOCKS)
+    dump_bb_info (outf, bb, indent, flags, true, false);
   if (cfg_hooks->dump_bb)
     cfg_hooks->dump_bb (outf, bb, indent, flags);
-  dump_bb_info (outf, bb, indent, flags, false, true);
+  if (flags & TDF_BLOCKS)
+    dump_bb_info (outf, bb, indent, flags, false, true);
   fputc ('\n', outf);
 }
 
 
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * error.c (print_instantiation_context): Pretty-print a newline before
+       diagnostic_flush_buffer.
+       * cxx-pretty-print.c (pp_cxx_function_definition): Use
+       pp_newline_and_flush instead of separate pp_newline and pp_flush.
+
 2012-08-06  Dodji Seketeli  <dodji@redhat.com>
 
        Avoid crashing on erroneous static_assert usage
 
   if (DECL_SAVED_TREE (t))
     pp_cxx_statement (pp, DECL_SAVED_TREE (t));
   else
-    {
-      pp_cxx_semicolon (pp);
-      pp_needs_newline (pp) = true;
-    }
-  pp_flush (pp);
+    pp_cxx_semicolon (pp);
+  pp_newline_and_flush (pp);
   pp->enclosing_scope = saved_scope;
 }
 
 
 {
   print_instantiation_partial_context
     (global_dc, current_instantiation (), input_location);
+  pp_base_newline (global_dc->printer);
   diagnostic_flush_buffer (global_dc);
 }
 \f
 
        pp_verbatim (context->printer,
                     _("%s: some warnings being treated as errors"),
                     progname);
-      pp_flush (context->printer);
+      pp_newline_and_flush (context->printer);
     }
 }
 
         try to flush out the previous error, then let this one
         through.  Don't do this more than once.  */
       if (diagnostic->kind == DK_ICE && context->lock == 1)
-       pp_flush (context->printer);
+       pp_newline_and_flush (context->printer);
       else
        error_recursion (context);
     }
   pp_output_formatted_text (context->printer);
   diagnostic_show_locus (context, diagnostic);
   (*diagnostic_finalizer (context)) (context, diagnostic);
-  pp_flush (context->printer);
+  pp_newline_and_flush (context->printer);
   diagnostic_action_after_output (context, diagnostic);
   diagnostic->message.format_spec = saved_format_spec;
   diagnostic->x_data = NULL;
   text.locus = NULL;
   text.x_data = NULL;
   pp_format_verbatim (global_dc->printer, &text);
-  pp_flush (global_dc->printer);
+  pp_newline_and_flush (global_dc->printer);
   va_end (ap);
 }
 
   diagnostic_info diagnostic;
 
   if (context->lock < 3)
-    pp_flush (context->printer);
+    pp_newline_and_flush (context->printer);
 
   fnotice (stderr,
           "Internal compiler error: Error reporting routines re-entered.\n");
 
 {
   maybe_init_pretty_print (file);
   dump_gimple_stmt (&buffer, g, spc, flags);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 
 {
   maybe_init_pretty_print (file);
   dump_gimple_seq (&buffer, seq, spc, flags);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 
 
       INDENT (curr_indent);
       dump_gimple_stmt (buffer, stmt, curr_indent, flags);
-      pp_flush (buffer);
+      pp_newline_and_flush (buffer);
       dump_histograms_for_stmt (cfun, buffer->buffer->stream, stmt);
     }
 
 
        }
 
       diagnostic_set_last_function (context, diagnostic);
-      pp_flush (context->printer);
+      pp_newline_and_flush (context->printer);
       context->printer->prefix = old_prefix;
       free ((char*) new_prefix);
     }
 
 {
   pp_write_text_to_stream (pp);
   pp_clear_state (pp);
-  fputc ('\n', pp->buffer->stream);
   fflush (pp->buffer->stream);
-  pp_needs_newline (pp) = false;
 }
 
 /* Sets the number of maximum characters per line PRETTY-PRINTER can
 
 #define pp_quote(PP)            pp_character (PP, '\'')
 #define pp_backquote(PP)        pp_character (PP, '`')
 #define pp_doublequote(PP)      pp_character (PP, '"')
+#define pp_newline_and_flush(PP)     \
+  do {                               \
+    pp_newline (PP);                 \
+    pp_flush (PP);                   \
+    pp_needs_newline (PP) = false;   \
+  } while (0)
 #define pp_newline_and_indent(PP, N) \
   do {                               \
     pp_indentation (PP) += N;        \
 
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * gcc.dg/tree-prof/update-loopch.c: Ask for dump with blocks info.
+       * gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
+       * gcc.dg/tree-ssa/pr18133-1.c: Likewise.
+
 2012-08-06  Cary Coutant  <ccoutant@google.com>
 
        * g++.dg/debug/dwarf2/non-virtual-thunk.C: New test case.
 
-/* { dg-options "-O2 -fdump-ipa-profile-details -fdump-tree-optimized-details" } */
+/* { dg-options "-O2 -fdump-ipa-profile-blocks-details -fdump-tree-optimized-blocks-details" } */
 int max = 33333;
 int a[8];
 int
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-profile_estimate-details" } */
+/* { dg-options "-O2 -fdump-ipa-profile_estimate-blocks-details" } */
 
 void g(void);
 void h(void);
 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized-details" } */
+/* { dg-options "-O1 -fdump-tree-optimized-blocks-details" } */
 
 void foo (void)
 {
 
 {
   maybe_init_pretty_print (file);
   dump_generic_node (&buffer, t, 0, flags, true);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 /* Print tree T, and its successors, on file FILE.  FLAGS specifies details
   for (i = 0; i < indent; i++)
     pp_space (&buffer);
   dump_generic_node (&buffer, t, indent, flags, true);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 /* Print a single expression T on file FILE.  FLAGS specifies details to show