cfg.c (debug_bb): Do not set TDF_BLOCKS.

gcc/
	* 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.

c-family/
	* 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.

cp/
	* 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.

testsuite/
	* 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.

From-SVN: r190215
This commit is contained in:
Steven Bosscher 2012-08-07 22:14:29 +00:00
parent 4ccaeceec0
commit f8923f7ead
18 changed files with 69 additions and 28 deletions

View File

@ -1,3 +1,23 @@
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

View File

@ -1,3 +1,9 @@
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.

View File

@ -846,8 +846,7 @@ pp_c_function_definition (c_pretty_printer *pp, tree t)
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);
}
@ -2361,8 +2360,7 @@ print_c_tree (FILE *file, tree t)
pp_statement (pp, t);
pp_newline (pp);
pp_flush (pp);
pp_newline_and_flush (pp);
}
/* Print the tree T in full, on stderr. */

View File

@ -652,7 +652,7 @@ free_aux_for_edges (void)
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

View File

@ -271,10 +271,12 @@ verify_flow_info (void)
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);
}

View File

@ -1,3 +1,10 @@
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

View File

@ -1625,11 +1625,8 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
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;
}

View File

@ -3194,6 +3194,7 @@ print_instantiation_context (void)
{
print_instantiation_partial_context
(global_dc, current_instantiation (), input_location);
pp_base_newline (global_dc->printer);
diagnostic_flush_buffer (global_dc);
}

View File

@ -172,7 +172,7 @@ diagnostic_finish (diagnostic_context *context)
pp_verbatim (context->printer,
_("%s: some warnings being treated as errors"),
progname);
pp_flush (context->printer);
pp_newline_and_flush (context->printer);
}
}
@ -530,7 +530,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
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);
}
@ -650,7 +650,7 @@ diagnostic_report_diagnostic (diagnostic_context *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;
@ -708,7 +708,7 @@ verbatim (const char *gmsgid, ...)
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);
}
@ -986,7 +986,7 @@ error_recursion (diagnostic_context *context)
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");

View File

@ -97,7 +97,7 @@ print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
{
maybe_init_pretty_print (file);
dump_gimple_stmt (&buffer, g, spc, flags);
pp_flush (&buffer);
pp_newline_and_flush (&buffer);
}
@ -143,7 +143,7 @@ print_gimple_seq (FILE *file, gimple_seq seq, int spc, int flags)
{
maybe_init_pretty_print (file);
dump_gimple_seq (&buffer, seq, spc, flags);
pp_flush (&buffer);
pp_newline_and_flush (&buffer);
}
@ -2247,7 +2247,7 @@ gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
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);
}

View File

@ -472,7 +472,7 @@ lhd_print_error_function (diagnostic_context *context, const char *file,
}
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);
}

View File

@ -575,9 +575,7 @@ pp_base_flush (pretty_printer *pp)
{
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

View File

@ -256,6 +256,12 @@ pp_base_get_prefix (const pretty_printer *pp) { return pp->prefix; }
#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; \

View File

@ -1,3 +1,9 @@
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.

View File

@ -1,4 +1,4 @@
/* { 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

View File

@ -1,5 +1,5 @@
/* { 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);

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized-details" } */
/* { dg-options "-O1 -fdump-tree-optimized-blocks-details" } */
void foo (void)
{

View File

@ -133,7 +133,7 @@ print_generic_stmt (FILE *file, tree t, int flags)
{
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
@ -150,7 +150,7 @@ print_generic_stmt_indented (FILE *file, tree t, int flags, int indent)
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