On Tue, Oct 13, 2015 at 4:57 AM, Yuri Rumyantsev <ysrum...@gmail.com> wrote: > Hi All, > > Here is a simple patch for unswitching outer loop through guard-edge > hoisting. The check that guard-edge is around the inner loop was > missed. > > Bootstrapping and regression testing did not show new failures. > > Is it OK for trunk? > > ChangeLog: > 2014-10-13 Yuri Rumyantsev <ysrum...@gmail.com> > > PR tree-optimization/67909, 67947 > * tree-ssa-loop-unswitch.c (find_loop_guard): Add check that GUARD_EDGE > really skip the inner loop. > > gcc/testsuite/ChangeLog > * gcc.dg/torture/pr67947.c: New test.
+ /* Guard edge must skip inner loop. */ + if (!dominated_by_p (CDI_DOMINATORS, loop->inner->header, + guard_edge == fe ? te->dest : fe->dest)) ^^^^ It should line up with "CDI_DOMINATORS". + fprintf (dump_file, "Guard edge %d --> %d is not around the loop!\n",guard_edge->src->index,guard_edge->dest->index); Please break lone line. -- H.J.