From 8d9c1aec9dbce27caf524d863e461b6471d2c1d6 Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Mon, 30 Jan 2006 03:11:29 +0000 Subject: re PR c++/25874 ([gomp] ICE in calc_dfs_tree()) PR 25874 * omp-low.c (execute_expand_omp): Move CFG cleanup code ... (expand_omp): ... here. (expand_omp_parallel): Only remove barriers for combined parallel+workshare constructs. * gcc.dg/gomp/pr25874.c: New test. From-SVN: r110393 --- gcc/omp-low.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'gcc/omp-low.c') diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 93ceb8e..38d4224 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -2279,13 +2279,16 @@ expand_omp_parallel (struct omp_region *region) entry_bb = bb_for_stmt (region->entry); exit_bb = bb_for_stmt (region->exit); - /* Barriers at the end of the function are not necessary and can be - removed. Since the caller will have a barrier of its own, this - one is superfluous. */ - remove_exit_barrier (region); - if (is_combined_parallel (region)) - ws_args = region->ws_args; + { + ws_args = region->ws_args; + + /* For combined parallel+workshare calls, barriers at the end of + the function are not necessary and can be removed. Since the + caller will have a barrier of its own, the workshare barrier is + superfluous. */ + remove_exit_barrier (region); + } else ws_args = NULL_TREE; @@ -3244,6 +3247,13 @@ expand_omp (struct omp_region *region) gcc_unreachable (); } + /* Expansion adds and removes basic block, edges, creates + and exposes unreachable regions that need to be cleaned up + before proceeding. */ + free_dominance_info (CDI_DOMINATORS); + free_dominance_info (CDI_POST_DOMINATORS); + cleanup_tree_cfg (); + region = region->next; } } @@ -3339,12 +3349,7 @@ execute_expand_omp (void) splay_tree_delete (omp_regions); root_omp_region = NULL; omp_regions = NULL; - free_dominance_info (CDI_DOMINATORS); - free_dominance_info (CDI_POST_DOMINATORS); } - - /* Expansion adds basic blocks that may be merged. */ - cleanup_tree_cfg (); } static bool -- cgit v1.1