------- Comment #3 from steven at gcc dot gnu dot org  2010-02-14 00:07 -------
User prefetches should never be scheduled. Andreas Krebbel posted a patch
towards that (http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00130.html) but he
hasn't followed up on it, so far.

Of course, in very rare corner cases, it is possible to have a non-user
prefetch and then all other code removed as dead. To handle this situation,
sched-ebb.c should not move the barrier after the jump into a new basic block.
But I don't know if this is the responsibility of the CFGRTL modification
interface, or of the user of this interface. If the latter, the following patch
would be necessary:

Index: sched-ebb.c
===================================================================
--- sched-ebb.c (revision 156750)
+++ sched-ebb.c (working copy)
@@ -174,8 +174,13 @@
          gcc_assert (NOTE_INSN_BASIC_BLOCK_P (BB_END (bb)));
        }
       else
-       /* Create an empty unreachable block after the INSN.  */
-       bb = create_basic_block (NEXT_INSN (insn), NULL_RTX, last_bb);
+       {
+         /* Create an empty unreachable block after the INSN.  */
+          rtx head = NEXT_INSN (insn);
+         while (head && BARRIER_P (head))
+           head = NEXT_INSN (head);
+         bb = create_basic_block (head, NULL_RTX, last_bb);
+       }

       /* split_edge () creates BB before E->DEST.  Keep in mind, that
         this operation extends scheduling region till the end of BB.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |krebbel at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43056

Reply via email to