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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124121
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2007-04-24 Ian Lance Taylor <iant@google.com>
PR tree-optimization/31602
value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \
$(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \
- $(CPPLIB_H) opts.h params.def tree-mudflap.h $(REAL_H)
+ $(CPPLIB_H) opts.h params.def tree-mudflap.h $(REAL_H) tree-pass.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DTARGET_NAME=\"$(target_noncanonical)\" \
-c $(srcdir)/toplev.c $(OUTPUT_OPTION)
+2007-04-24 Simon Martin <simartin@users.sourceforge.net>
+
+ PR diagnostic/25923
+ * gfortran.dg/pr25923.f90: New test.
+
2007-04-24 Ian Lance Taylor <iant@google.com>
PR tree-optimization/31602
--- /dev/null
+! { dg-do compile }
+! { dg-options "-O -Wuninitialized" }
+
+module foo
+implicit none
+
+ type bar
+ integer :: yr
+ end type
+
+contains
+
+ function baz(arg) result(res) ! { dg-warning "res.yr' may be" }
+ type(bar), intent(in) :: arg
+ type(bar) :: res
+ logical, external:: some_func
+ if (.not. some_func(arg)) then
+ call fatal('arg not valid')
+ else
+ res = arg
+ end if
+ end function baz
+
+end module foo
#include "value-prof.h"
#include "alloc-pool.h"
#include "tree-mudflap.h"
+#include "tree-pass.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
pp_string (pp, n);
}
else
- dump_generic_node (pp, t, 0, 0, 0);
+ dump_generic_node (pp, t, 0, TDF_DIAGNOSTIC, 0);
return true;
}
#define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr.
Implies TDF_VOPS. */
+#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
+ message. */
+
extern char *get_dump_file_name (enum tree_dump_index);
extern int dump_enabled_p (enum tree_dump_index);
extern int dump_initialized_p (enum tree_dump_index);
/* 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
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;
}