On 06/14/2011 07:34 AM, Alexander Monakov wrote:
Hello,

Quoting myself from the PR audit trail,

It's a rare bug in sel-sched: we fail to schedule some code in non-pipelining
mode.  The root cause is that we put bookkeeping instructions above a fence
that is placed on the last insn (uncond. jump) of the bookkeeping block.  We
could either make such blocks ineligible for bookkeeping or rewind such fences
from the jump back to the bookkeeping code (there's also a more involved
approach of re-introducing the idea of using local nops as placeholders for
fences).  I'm testing the following patch that implements the second approach
(as it should result in a bit cleaner code in such situations).

I'm also removing a conditional that allows NULL place_to_insert in
generate_bookkeeping_insn, as I don't see how it can possibly happen with
current implementation of find_place_for_bookkeeping.

Bootstrapped and regtested on ia64-linux, OK for trunk?  Steve Ellcey
confirmed that HP-UX testing is OK as well.

Ok.  Thanks, Alexander.
2011-06-14  Alexander Monakov<amona...@ispras.ru>

        PR target/49349
        * sel-sched.c (find_place_for_bookkeeping): Add new parameter
        (fence_to_rewind).  Use it to notice when bookkeeping will be placed
        above a fence.  Update comments.
        (generate_bookkeeping_insn): Rewind fence when bookkeeping code is
        placed just above it.  Do not allow NULL place_to_insert.


Reply via email to