From 7aab672f4239ec94b577d1377b2cd0ac8655df35 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 12 Oct 2015 14:14:11 +0000 Subject: [PATCH] Handle simple latch in expand_omp_for_generic 2015-10-12 Tom de Vries PR tree-optimization/67476 * omp-low.c (expand_omp_for_generic): Handle simple latch. From-SVN: r228717 --- gcc/ChangeLog | 5 +++++ gcc/omp-low.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d721c15b97..97f4a0d7b2d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-12 Tom de Vries + + PR tree-optimization/67476 + * omp-low.c (expand_omp_for_generic): Handle simple latch. + 2015-10-12 Christophe Lyon * config/aarch64/aarch64-simd-builtins.def: Update builtins diff --git a/gcc/omp-low.c b/gcc/omp-low.c index cdcf9d6d9c8..f59a6a436f0 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -6162,7 +6162,9 @@ expand_omp_for_generic (struct omp_region *region, if (!broken_loop) { l2_bb = create_empty_bb (cont_bb); - gcc_assert (BRANCH_EDGE (cont_bb)->dest == l1_bb); + gcc_assert (BRANCH_EDGE (cont_bb)->dest == l1_bb + || (single_succ_edge (BRANCH_EDGE (cont_bb)->dest)->dest + == l1_bb)); gcc_assert (EDGE_COUNT (cont_bb->succs) == 2); } else @@ -6438,6 +6440,11 @@ expand_omp_for_generic (struct omp_region *region, make_edge (cont_bb, l2_bb, EDGE_FALSE_VALUE); add_bb_to_loop (l2_bb, cont_bb->loop_father); e = find_edge (cont_bb, l1_bb); + if (e == NULL) + { + e = BRANCH_EDGE (cont_bb); + gcc_assert (single_succ (e->dest) == l1_bb); + } if (gimple_omp_for_combined_p (fd->for_stmt)) { remove_edge (e); -- 2.30.2