diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2007-04-24 20:52:16 +0000 |
---|---|---|
committer | Simon Martin <simartin@gcc.gnu.org> | 2007-04-24 20:52:16 +0000 |
commit | 438d798f1231f01c92211c76df1cc3b4cf6904a4 (patch) | |
tree | 8114578ec066c8fc958ebd7608cf29fdaca0d26e /gcc/tree-pretty-print.c | |
parent | 4df28528f69a4400fed72d69792fc043d1ebd826 (diff) | |
download | gcc-438d798f1231f01c92211c76df1cc3b4cf6904a4.zip gcc-438d798f1231f01c92211c76df1cc3b4cf6904a4.tar.gz gcc-438d798f1231f01c92211c76df1cc3b4cf6904a4.tar.bz2 |
re PR middle-end/25923 ([gfortran] garbled diagnostics with -O -Wuninitialized)
2007-04-24 Simon Martin <simartin@users.sourceforge.net>
PR diagnostic/25923
* tree-pass.h (TDF_DIAGNOSTIC): New dump control to specify that a
diagnostic message is being built.
* tree-pretty-print.c (dump_generic_node): Only write the formatted text
into BUFFER's stream if we are not building a diagnostic message.
* toplev.c (default_tree_printer): Pass TDF_DIAGNOSTIC to
dump_generic_node.
* Makefile.in (toplev.o): Depend on tree-pass.h.
From-SVN: r124121
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index ab637a8..32f8ac0 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -431,8 +431,8 @@ dump_symbols (pretty_printer *buffer, bitmap syms, int flags) /* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent. - FLAGS specifies details to show in the dump (see TDF_* in tree.h). If - IS_STMT is true, the object printed is considered to be a statement + FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h). + If IS_STMT is true, the object printed is considered to be a statement and it is terminated by ';' if appropriate. */ int @@ -2055,7 +2055,11 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (is_stmt && is_expr) pp_semicolon (buffer); - pp_write_text_to_stream (buffer); + + /* If we're building a diagnostic, the formatted text will be written + into BUFFER's stream by the caller; otherwise, write it now. */ + if (!(flags & TDF_DIAGNOSTIC)) + pp_write_text_to_stream (buffer); return spc; } |