OSDN Git Service

PR middle-end/54017
[pf3gnuchains/gcc-fork.git] / gcc / tree-cfgcleanup.c
index ad8e477..8348d25 100644 (file)
@@ -599,7 +599,7 @@ split_bbs_on_noreturn_calls (void)
           BB is present in the cfg.  */
        if (bb == NULL
            || bb->index < NUM_FIXED_BLOCKS
-           || bb->index >= n_basic_blocks
+           || bb->index >= last_basic_block
            || BASIC_BLOCK (bb->index) != bb
            || !gimple_call_noreturn_p (stmt))
          continue;
@@ -610,48 +610,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))
@@ -1054,7 +1019,7 @@ struct gimple_opt_pass pass_merge_phi =
   0,                           /* properties_provided */
   0,                           /* properties_destroyed */
   0,                           /* todo_flags_start */
-  TODO_dump_func | TODO_ggc_collect    /* todo_flags_finish */
+  TODO_ggc_collect             /* todo_flags_finish */
   | TODO_verify_ssa
  }
 };