summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-07 22:14:29 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-07 22:14:29 +0000
commit5f7f600e3703fbfc4ae4c731e419b996c6708a85 (patch)
treebbf26213eed7cd6f579798de7efa91d85e8507d0
parentffc5b2da9fd01448286d9736a0dc002a4ae6b9fe (diff)
downloadgcc-5f7f600e3703fbfc4ae4c731e419b996c6708a85.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190215 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog20
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-pretty-print.c6
-rw-r--r--gcc/cfg.c2
-rw-r--r--gcc/cfghooks.c6
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cxx-pretty-print.c7
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/diagnostic.c10
-rw-r--r--gcc/gimple-pretty-print.c6
-rw-r--r--gcc/langhooks.c2
-rw-r--r--gcc/pretty-print.c2
-rw-r--r--gcc/pretty-print.h6
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/update-loopch.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c2
-rw-r--r--gcc/tree-pretty-print.c4
18 files changed, 69 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 295efad7b92..1bffab78e3d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 983a93e4949..7181930e488 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -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.
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index d445187907d..e040a3744b5 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -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. */
diff --git a/gcc/cfg.c b/gcc/cfg.c
index f8614074ff6..2b4e9085068 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -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
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index be117cfbacf..a7b653b220c 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -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);
}
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5452a1cb836..db335c85bfb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index eef3489e762..03d9149f4cf 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -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;
}
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 58f0aff9397..17646e2c5a1 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -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);
}
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 4913eed9c67..b3ae86c74a8 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -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");
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index a9b071c82e4..af7c39a2778 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -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);
}
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index a34733f13b3..a9e60f9ea68 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -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);
}
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 4033ba38715..c1282c78a9e 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -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
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index a7b5a9fbbba..e0fd2e98c9d 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -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; \
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5eeb52629eb..61ac4e708c6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c b/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
index 3388996a8c9..cc06ea7396b 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
@@ -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
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
index 84327fe52d5..27c4bfa27ce 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
@@ -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);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
index 8a26479e294..8bae0145d79 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
@@ -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)
{
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 4ac601c083b..c7bb5206454 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -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