From bd54250843b21166cb59fec813cd095b93bd3469 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 27 Feb 2016 23:34:20 -0700 Subject: [PATCH] Revert 2016-02-26 Richard Biener Jeff Law PR tree-optimization/69740 * cfghooks.c (remove_edge): Request loop fixups if we delete an edge that might turn an irreducible loop into a natural loop. Revert 2016-02-26 Richard Biener Jeff Law PR tree-optimization/69740 * gcc.c-torture/compile/pr69740-1.c: New test. * gcc.c-torture/compile/pr69740-2.c: New test. From-SVN: r233787 --- gcc/ChangeLog | 11 +++++++++++ gcc/cfghooks.c | 15 +-------------- gcc/testsuite/ChangeLog | 10 ++++++++++ .../gcc.c-torture/compile/pr69740-1.c | 12 ------------ .../gcc.c-torture/compile/pr69740-2.c | 19 ------------------- 5 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 gcc/testsuite/gcc.c-torture/compile/pr69740-1.c delete mode 100644 gcc/testsuite/gcc.c-torture/compile/pr69740-2.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57a81f3de86..85c6301bf6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2016-02-27 Jeff Law + + Revert + 2016-02-26 Richard Biener + Jeff Law + + PR tree-optimization/69740 + * cfghooks.c (remove_edge): Request loop fixups if we delete + an edge that might turn an irreducible loop into a natural + loop. + 2016-02-27 Jakub Jelinek PR rtl-optimization/69896 diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 06c05d1fb39..bbb1017fd1f 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -408,20 +408,7 @@ void remove_edge (edge e) { if (current_loops != NULL) - { - rescan_loop_exit (e, false, true); - - /* Removal of an edge inside an irreducible region or which leads - to an irreducible region can turn the region into a natural loop. - In that case, ask for the loop structure fixups. - - FIXME: Note that LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS is not always - set, so always ask for fixups when removing an edge in that case. */ - if (!loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) - || (e->flags & EDGE_IRREDUCIBLE_LOOP) - || (e->dest->flags & BB_IRREDUCIBLE_LOOP)) - loops_state_set (LOOPS_NEED_FIXUP); - } + rescan_loop_exit (e, false, true); /* This is probably not needed, but it doesn't hurt. */ /* FIXME: This should be called via a remove_edge hook. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2c2102e962f..c809e2ca8eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2016-02-27 Jeff Law + + Revert + 2016-02-26 Richard Biener + Jeff Law + + PR tree-optimization/69740 + * gcc.c-torture/compile/pr69740-1.c: New test. + * gcc.c-torture/compile/pr69740-2.c: New test. + 2016-02-27 Jerry DeLisle PR fortran/69910 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr69740-1.c b/gcc/testsuite/gcc.c-torture/compile/pr69740-1.c deleted file mode 100644 index ac867d8a999..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/pr69740-1.c +++ /dev/null @@ -1,12 +0,0 @@ -char a; -short b; -void fn1() { - if (b) - ; - else { - int c[1] = {0}; - l1:; - } - if (a) - goto l1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr69740-2.c b/gcc/testsuite/gcc.c-torture/compile/pr69740-2.c deleted file mode 100644 index a89c9a0fd12..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/pr69740-2.c +++ /dev/null @@ -1,19 +0,0 @@ -inline int foo(int *p1, int p2) { - int z = *p1; - while (z > p2) - p2 = 2; - return z; -} -int main() { - int i; - for (;;) { - int j, k; - i = foo(&k, 7); - if (k) - j = i; - else - k = j; - if (2 != j) - __builtin_abort(); - } -} -- 2.30.2