Hello,
This is the patch for the second testcase of PR 42246. The problem
here is in our region walk iterator that happens when pipelining outer
loops. When looking for loop exits from an inner loop that is
contained in the outer loop currently being pipelined, we need to work
harder to skip several consecutive inner loops if needed. The
iterator assumes that all preheaders of inner loops are available, so
when skipping an inner loop, it expects to find a block of an outer
loop (which is possibly the preheader of the next inner loop). When
we are removing empty blocks in the region body, this is not the case,
and we are immediately hitting the header of the next inner loop.
Fortunately, the bug is rather easily fixed by using the already
existing infrastructure.
Janis has confirmed at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42245#c8 that with the
patch the SPEC tests on ppc64 are clean, so -- ok for trunk?
Yours, Andrey
2010-01-12 Andrey Belevantsev <abel@ispras.ru>
Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/42246
* sel-sched-ir.h (get_all_loop_exits): Include headers of inner
loops.
* gfortran.dg/pr42246-2.f: New.