summaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 78583c47e1b..45f33682e30 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -31,8 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "langhooks.h"
#include "tree-flow.h"
-#include "timevar.h"
-#include "tree-dump.h"
#include "tree-pass.h"
#include "except.h"
#include "cfgloop.h"
@@ -608,48 +606,13 @@ split_bbs_on_noreturn_calls (void)
return changed;
}
-/* If GIMPLE_OMP_RETURN in basic block BB is unreachable, remove it. */
-
-static bool
-cleanup_omp_return (basic_block bb)
-{
- gimple stmt = last_stmt (bb);
- basic_block control_bb;
-
- if (stmt == NULL
- || gimple_code (stmt) != GIMPLE_OMP_RETURN
- || !single_pred_p (bb))
- return false;
-
- control_bb = single_pred (bb);
- stmt = last_stmt (control_bb);
-
- if (stmt == NULL || gimple_code (stmt) != GIMPLE_OMP_SECTIONS_SWITCH)
- return false;
-
- /* The block with the control statement normally has two entry edges -- one
- from entry, one from continue. If continue is removed, return is
- unreachable, so we remove it here as well. */
- if (EDGE_COUNT (control_bb->preds) == 2)
- return false;
-
- gcc_assert (EDGE_COUNT (control_bb->preds) == 1);
- remove_edge_and_dominated_blocks (single_pred_edge (bb));
- return true;
-}
-
/* Tries to cleanup cfg in basic block BB. Returns true if anything
changes. */
static bool
cleanup_tree_cfg_bb (basic_block bb)
{
- bool retval = false;
-
- if (cleanup_omp_return (bb))
- return true;
-
- retval = cleanup_control_flow_bb (bb);
+ bool retval = cleanup_control_flow_bb (bb);
if (tree_forwarder_block_p (bb, false)
&& remove_forwarder_block (bb))
@@ -774,6 +737,8 @@ repair_loop_structures (void)
{
bitmap changed_bbs;
+ calculate_dominance_info (CDI_DOMINATORS);
+
timevar_push (TV_REPAIR_LOOPS);
changed_bbs = BITMAP_ALLOC (NULL);
fix_loop_structure (changed_bbs);