diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2010-07-13 21:55:57 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2010-07-13 22:55:57 +0100 |
commit | c31c32f95917cef39e066fd8964abc55c3d5aeac (patch) | |
tree | 78e64b469ad027c41fccce9021395470fd154b69 /gcc/tree-optimize.c | |
parent | 5bca11c4efc6271558e920c5a2395bc27ea18e74 (diff) | |
download | gcc-c31c32f95917cef39e066fd8964abc55c3d5aeac.zip gcc-c31c32f95917cef39e066fd8964abc55c3d5aeac.tar.gz gcc-c31c32f95917cef39e066fd8964abc55c3d5aeac.tar.bz2 |
re PR other/44874 (TDF_NOUID dumps miss information about DECL_UID ordering)
gcc:
PR other/44874
* tree-dump.c (dump_options): Add enumerate_locals entry.
Add TDF_NOID exclusion to all entry.
* tree-dump.h (dump_enumerated_decls): Declare.
* tree-pretty-print.c (dump_generic_node): For TDF_NOID,
Don't display type uid.
(print_declaration): Don't crash on TREE_TYPE (t) == 0.
* tree-pass.h (TDF_ENUMERATE_LOCALS): Define.
* tree-ssa-live.c: Include gimple.h.
(numbered_tree_d): New struct.
(numbered_tree): New typedef.
(DEF_VEC_O (numbered_tree): New.
(DEF_VEC_ALLOC_O (numbered_tree, heap)): Likewise.
(compare_decls_by_uid, dump_enumerated_decls_push): New functions.
(dump_enumerated_decls): Likewise.
* tree-optimize.c (execute_cleanup_cfg_post_optimizing): If comparing
debug info and flag_dump_final_insns, call dump_enumerated_decls.
* tree-cfg.c (dump_function_to_file): Call dump_enumerated_decls.
* Makefile.in (tree-ssa-live.o): Depend on $(GIMPLE_H).
gcc/testsuite:
PR other/44874
PR debug/44832
* c-c++-common/pr44832.c: New test.
From-SVN: r162156
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r-- | gcc/tree-optimize.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index aebcbb1..e736b4f 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -191,6 +191,35 @@ execute_cleanup_cfg_post_optimizing (void) cleanup_tree_cfg (); cleanup_dead_labels (); group_case_labels (); + if ((flag_compare_debug_opt || flag_compare_debug) + && flag_dump_final_insns) + { + FILE *final_output = fopen (flag_dump_final_insns, "a"); + + if (!final_output) + { + error ("could not open final insn dump file %qs: %m", + flag_dump_final_insns); + flag_dump_final_insns = NULL; + } + else + { + int save_unnumbered = flag_dump_unnumbered; + int save_noaddr = flag_dump_noaddr; + + flag_dump_noaddr = flag_dump_unnumbered = 1; + fprintf (final_output, "\n"); + dump_enumerated_decls (final_output, dump_flags | TDF_NOUID); + flag_dump_noaddr = save_noaddr; + flag_dump_unnumbered = save_unnumbered; + if (fclose (final_output)) + { + error ("could not close final insn dump file %qs: %m", + flag_dump_final_insns); + flag_dump_final_insns = NULL; + } + } + } return 0; } |