]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/60901 (ICE: SIGSEGV in add_to_deps_list with -fsel...
authorAndrey Belevantsev <abel@ispras.ru>
Tue, 3 Jun 2014 09:20:36 +0000 (13:20 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Tue, 3 Jun 2014 09:20:36 +0000 (13:20 +0400)
Backport from mainline

2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
        PR rtl-optimization/60901

        * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
        bb predecessor belongs to the same scheduling region.  Adjust comment.

        * gcc.target/i386/pr60901.c: New test.

From-SVN: r211164

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr60901.c [new file with mode: 0644]

index d2b03520039873c57a273a9dd02299aa97c03e7d..278e13316cd96faa72d074625ff4d7331873d84d 100644 (file)
@@ -1,3 +1,12 @@
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR rtl-optimization/60901
+       * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that
+       bb predecessor belongs to the same scheduling region.  Adjust comment.
+
 2014-06-03  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index fa81d0fbbefc1938de0f0f6cc704cfed4b4caa09..4ad76bd7fcca307faedf9249cee5d03cc26b0385 100644 (file)
@@ -24640,13 +24640,17 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail)
              {
                edge e;
                edge_iterator ei;
-               /* Assume that region is SCC, i.e. all immediate predecessors
-                  of non-head block are in the same region.  */
+
+               /* Regions are SCCs with the exception of selective
+                  scheduling with pipelining of outer blocks enabled.
+                  So also check that immediate predecessors of a non-head
+                  block are in the same region.  */
                FOR_EACH_EDGE (e, ei, bb->preds)
                  {
                    /* Avoid creating of loop-carried dependencies through
-                      using topological odering in region.  */
-                   if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
+                      using topological ordering in the region.  */
+                   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); 
                  }
              }
index da44bda52ffdb72c7d6f5b87cdf2f4b4d3b9acf0..a165e84e458a3123857a46c10056535985facf3d 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-03  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR rtl-optimization/60901
+       * gcc.target/i386/pr60901.c: New test.
+
 2014-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        Backport from mainline
diff --git a/gcc/testsuite/gcc.target/i386/pr60901.c b/gcc/testsuite/gcc.target/i386/pr60901.c
new file mode 100644 (file)
index 0000000..f0f25a1
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts"  } */
+
+extern int n;
+extern void bar (void);
+extern int baz (int);
+
+void
+foo (void)
+{
+  int i, j;
+  for (j = 0; j < n; j++)
+    {
+      for (i = 1; i < j; i++)
+       bar ();
+      baz (0);
+    }
+}