]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Handle simple latch in expand_omp_for_generic
authorTom de Vries <tom@codesourcery.com>
Mon, 12 Oct 2015 14:14:11 +0000 (14:14 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 12 Oct 2015 14:14:11 +0000 (14:14 +0000)
2015-10-12  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/67476
* omp-low.c (expand_omp_for_generic): Handle simple latch.

From-SVN: r228717

gcc/ChangeLog
gcc/omp-low.c

index 4d721c15b97c571af6ea39f342b925460bbd5b88..97f4a0d7b2d26c2a74433f3472c6a4c4ef74d2ec 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-12  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/67476
+       * omp-low.c (expand_omp_for_generic): Handle simple latch.
+
 2015-10-12  Christophe Lyon  <christophe.lyon@linaro.org>
 
        * config/aarch64/aarch64-simd-builtins.def: Update builtins
index cdcf9d6d9c8477cef406a5c70c1e07c867f93ec9..f59a6a436f02dae5fc8ea6f028cbc018e7e91cf4 100644 (file)
@@ -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);