[PATCH] sel-sched: Avoid placing bookkeeping code above a fence (PR49349)

Vladimir Makarov vmakarov@redhat.com
Tue Jun 14 20:34:00 GMT 2011


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<amonakov@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.
>



More information about the Gcc-patches mailing list