aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2012-07-19 16:02:32 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-07-19 16:02:32 +0200
commit65e7bfe359febac74ebd3de0c36e735166205950 (patch)
treeb2ceb968dce32746620d8c2755e65d81bba8a568 /gcc/tree-cfgcleanup.c
parent867ff7ed192fe7f614ad5c5429519f7e865e20f0 (diff)
downloadgcc-65e7bfe359febac74ebd3de0c36e735166205950.zip
gcc-65e7bfe359febac74ebd3de0c36e735166205950.tar.gz
gcc-65e7bfe359febac74ebd3de0c36e735166205950.tar.bz2
re PR middle-end/54017 (Incorrect implementation of infinite loops in OpenMP sections leads to SIGILL)
PR middle-end/54017 * tree-cfgcleanup.c (cleanup_omp_return): Remove. (cleanup_tree_cfg_bb): Don't call it. * omp-low.c (expand_omp_sections): Fix up the !exit_reachable case handling. * c-c++-common/gomp/pr54017.c: New test. From-SVN: r189658
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index ca79e79..b665c58 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -606,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))