diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-17 02:01:35 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-17 02:01:35 +0000 |
commit | cbcbd868bd5105a82cf3a9a679b073f785c170bb (patch) | |
tree | 4b863c2d1c67c8fb1155677401f221fcedc209fc /gcc | |
parent | 3020fc71419177431d94560b33dba90f807860ff (diff) | |
download | gcc-cbcbd868bd5105a82cf3a9a679b073f785c170bb.tar.gz |
2004-11-16 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/18519
* tree-optimize (execute_todo): Add case for TODO_cleanup_cfg.
* tree-pass.h: Add TODO_cleanup_cfg.
* tree-ssa-ccp.c (pass_ccp): Use TODO_cleanup_cfg.
(ccp_finalize): Remove call to cleanup_cfg.
* tree-ssa-dce.c (pass_dce): Use TODO_cleanup_cfg and TODO_dump_func.
(pass_cd_dce): Ditto.
(perform_tree_ssa_dce): Remove call to cleanup_cfg,
dump_function_to_file.
* tree-ssa-loop-ch.c (copy_loop_headers): Remove call
to cleanup_cfg.
(pass_ch): Add TODO_cleanup_cfg.
* tree-ssa-loop.c (tree_ssa_loop_done): Remove call to
cleanup_cfg.
(pass_loop_done): Add TODO_cleanup_cfg.
* tree-ssa-phiopt.c (pass_phiopt): Ditto.
(tree_ssa_phiopt): Remove call to cleanup_cfg.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90783 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/tree-optimize.c | 3 | ||||
-rw-r--r-- | gcc/tree-pass.h | 1 | ||||
-rw-r--r-- | gcc/tree-ssa-ccp.c | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-dce.c | 11 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ch.c | 9 | ||||
-rw-r--r-- | gcc/tree-ssa-loop.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 7 |
8 files changed, 33 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f7fba24ab7..e54898105ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2004-11-16 Daniel Berlin <dberlin@dberlin.org> + + Fix PR tree-optimization/18519 + + * tree-optimize (execute_todo): Add case for TODO_cleanup_cfg. + * tree-pass.h: Add TODO_cleanup_cfg. + * tree-ssa-ccp.c (pass_ccp): Use TODO_cleanup_cfg. + (ccp_finalize): Remove call to cleanup_cfg. + * tree-ssa-dce.c (pass_dce): Use TODO_cleanup_cfg and TODO_dump_func. + (pass_cd_dce): Ditto. + (perform_tree_ssa_dce): Remove call to cleanup_cfg, + dump_function_to_file. + * tree-ssa-loop-ch.c (copy_loop_headers): Remove call + to cleanup_cfg. + (pass_ch): Add TODO_cleanup_cfg. + * tree-ssa-loop.c (tree_ssa_loop_done): Remove call to + cleanup_cfg. + (pass_loop_done): Add TODO_cleanup_cfg. + * tree-ssa-phiopt.c (pass_phiopt): Ditto. + (tree_ssa_phiopt): Remove call to cleanup_cfg. + 2004-11-16 Devang Patel <dpatel@apple.com> * optabs.c (vector_compare_rtx): Fix COMPARISON_CLASS_P use. diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index da7a2e7e6e3..53356b94d55 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -426,6 +426,9 @@ execute_todo (int properties, unsigned int flags) bitmap_clear (vars_to_rename); } + if (flags & TODO_cleanup_cfg) + cleanup_tree_cfg (); + if ((flags & TODO_dump_func) && dump_file) { if (properties & PROP_trees) diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 71407665679..8900bcc6d42 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -107,6 +107,7 @@ struct dump_file_info #define TODO_verify_flow (1 << 4) #define TODO_verify_stmts (1 << 5) #define TODO_fix_def_def_chains (1 << 6) /* rewrite def-def chains */ +#define TODO_cleanup_cfg (1 << 7) /* cleanup the cfg. */ #define TODO_verify_all \ (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts) diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 42094805b41..1815ebd4d73 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -629,9 +629,6 @@ ccp_finalize (void) /* Perform substitutions based on the known constant values. */ substitute_and_fold (); - /* Now cleanup any unreachable code. */ - cleanup_tree_cfg (); - free (value_vector); } @@ -1229,7 +1226,7 @@ struct tree_opt_pass pass_ccp = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_rename_vars + TODO_cleanup_cfg | TODO_dump_func | TODO_rename_vars | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_stmts, /* todo_flags_finish */ 0 /* letter */ diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index 54733541a0e..589fc5b4f8a 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -951,14 +951,9 @@ perform_tree_ssa_dce (bool aggressive) if (aggressive) free_dominance_info (CDI_POST_DOMINATORS); - cleanup_tree_cfg (); - /* Debugging dumps. */ if (dump_file) - { - dump_function_to_file (current_function_decl, dump_file, dump_flags); - print_stats (); - } + print_stats (); tree_dce_done (aggressive); @@ -997,7 +992,7 @@ struct tree_opt_pass pass_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_fix_def_def_chains |TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */ + TODO_dump_func | TODO_fix_def_def_chains | TODO_cleanup_cfg | TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */ 0 /* letter */ }; @@ -1014,7 +1009,7 @@ struct tree_opt_pass pass_cd_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_fix_def_def_chains | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow, + TODO_dump_func | TODO_fix_def_def_chains | TODO_cleanup_cfg | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow, /* todo_flags_finish */ 0 /* letter */ }; diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index ecdf6f2cc2c..71d1bf2162c 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -214,11 +214,6 @@ copy_loop_headers (void) #endif loop_optimizer_finalize (loops, NULL); - - /* Run cleanup_tree_cfg here regardless of whether we have done anything, so - that we cleanup the blocks created in order to get the loops into a - canonical shape. */ - cleanup_tree_cfg (); } static bool @@ -240,7 +235,7 @@ struct tree_opt_pass pass_ch = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - (TODO_dump_func - | TODO_verify_ssa), /* todo_flags_finish */ + TODO_cleanup_cfg | TODO_dump_func + | TODO_verify_ssa, /* todo_flags_finish */ 0 /* letter */ }; diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index 8ec9c3de349..570dd420340 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -411,7 +411,6 @@ tree_ssa_loop_done (void) loop_optimizer_finalize (current_loops, (dump_flags & TDF_DETAILS ? dump_file : NULL)); current_loops = NULL; - cleanup_tree_cfg (); } struct tree_opt_pass pass_loop_done = @@ -427,7 +426,7 @@ struct tree_opt_pass pass_loop_done = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ + TODO_cleanup_cfg | TODO_dump_func, /* todo_flags_finish */ 0 /* letter */ }; diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 1d871d00873..3c241e43fc5 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -137,11 +137,6 @@ tree_ssa_phiopt (void) } } } - - /* If we removed any PHIs, then we have unreachable blocks and blocks - which need to be merged in the CFG. */ - if (removed_phis) - cleanup_tree_cfg (); } /* Return TRUE if block BB has no executable statements, otherwise return @@ -668,7 +663,7 @@ struct tree_opt_pass pass_phiopt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_ggc_collect /* todo_flags_finish */ + TODO_cleanup_cfg | TODO_dump_func | TODO_ggc_collect /* todo_flags_finish */ | TODO_verify_ssa | TODO_rename_vars | TODO_verify_flow, 0 /* letter */ |