diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-29 16:32:00 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-29 16:32:00 +0000 |
commit | 0c6b47034b467e4b02581be33b99e90bae24c6a3 (patch) | |
tree | b726ec8795790e3c447d315a30f79bfbbd34ed85 /gcc/tree-cfgcleanup.c | |
parent | 446faf9d7a8a1d1ed8510e5c169b763fb51c7027 (diff) | |
download | gcc-0c6b47034b467e4b02581be33b99e90bae24c6a3.tar.gz |
PR 22550
* tree-cfgcleanup.c (cleanup_tree_cfg_1): Extract from ...
(cleanup_tree_cfg): ... here.
Call cleanup_tree_cfg_1 until there are no more cleanups to
do.
testsuite/ChangeLog
PR 22550
* g++.dg/tree-ssa/pr22550.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102559 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 51b2fc59465..f2454b01119 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -489,14 +489,12 @@ cleanup_forwarder_blocks (void) return changed; } -/* Remove unreachable blocks and other miscellaneous clean up work. */ +/* Do one round of CFG cleanup. */ -bool -cleanup_tree_cfg (void) +static bool +cleanup_tree_cfg_1 (void) { - bool retval = false; - - timevar_push (TV_TREE_CLEANUP_CFG); + bool retval; retval = cleanup_control_flow (); retval |= delete_unreachable_blocks (); @@ -516,6 +514,28 @@ cleanup_tree_cfg (void) end_recording_case_labels (); } + /* Merging the blocks may create new opportunities for folding + conditional branches (due to the elimination of single-valued PHI + nodes). */ + retval |= merge_seq_blocks (); + + return retval; +} + + +/* Remove unreachable blocks and other miscellaneous clean up work. */ + +bool +cleanup_tree_cfg (void) +{ + bool retval; + int i; + + timevar_push (TV_TREE_CLEANUP_CFG); + + for (retval = true, i = 0; i < 5 && retval; i++) + retval = cleanup_tree_cfg_1 (); + #ifdef ENABLE_CHECKING if (retval) { @@ -526,16 +546,14 @@ cleanup_tree_cfg (void) } #endif - /* Merging the blocks creates no new opportunities for the other - optimizations, so do it here. */ - retval |= merge_seq_blocks (); - compact_blocks (); #ifdef ENABLE_CHECKING verify_flow_info (); #endif + timevar_pop (TV_TREE_CLEANUP_CFG); + return retval; } |