It turns out v4 wasn't quite complete anyway; so here "v5".

If a candidate PRE cannot get the prologue because a block BB is
reachable from it, but PRE does not dominate BB, we try again with the
dominators of PRE.  That "try again" needs to again consider BB though,
we aren't done with it.

This fixes this problem.  Tested on the 68909 testcase, and bootstrapped
and regression checked on powerpc64-linux.  Is this okay for trunk?


Segher


2015-12-17  Segher Boessenkool  <seg...@kernel.crashing.org>

        PR rtl-optimization/67778
        PR rtl-optimization/68634
        PR rtl-optimization/68909
        * shrink-wrap.c (try_shrink_wrapping): If BB isn't dominated by PRE,
        push it back on VEC.

---
 gcc/shrink-wrap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c
index f65b0c3..85e5a8b 100644
--- a/gcc/shrink-wrap.c
+++ b/gcc/shrink-wrap.c
@@ -781,6 +781,7 @@ try_shrink_wrapping (edge *entry_edge, bitmap_head *bb_with,
              if (!dominated_by_p (CDI_DOMINATORS, bb, pre))
                {
                  ok = false;
+                 vec.quick_push (bb);
                  break;
                }
 
-- 
1.9.3

Reply via email to