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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |abel at gcc dot gnu.org

--- Comment #3 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
The ix86_dependencies_evaluation_hook has the following code:

26230                 /* Assume that region is SCC, i.e. all immediate
predecessors
26231                    of non-head block are in the same region.  */
26232                 FOR_EACH_EDGE (e, ei, bb->preds)
26233                   {

The comment is wrong for selective scheduling with pipelining of outer loops
enabled, as the regions then are formed started from the innermost loops and
going up to the outer loops.  So there could be a hole in the outer loop
region.

Fixed easily below like this, the comment has also to be adjusted of course.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 895ebbb..3f572fc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -26233,7 +26233,8 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail)
                  {
                    /* Avoid creating of loop-carried dependencies through
                       using topological odering in region.  */
-                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
+                   if (rgn == CONTAINING_RGN (e->src->index)
+                       && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB
(e->src->index))
                      add_dependee_for_func_arg (first_arg, e->src);
                  }
              }

Reply via email to