]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/60901 (ICE: SIGSEGV in add_to_deps_list with -fsel-sched-pipel...
authorAndrey Belevantsev <abel@ispras.ru>
Wed, 14 May 2014 09:46:26 +0000 (13:46 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Wed, 14 May 2014 09:46:26 +0000 (13:46 +0400)
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: r210414

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

index ce44dbd3849f3a9bd9b734ff911886c34724b7be..c63b0b923d73eb5f96714f44a703dc58c8e5f400 100644 (file)
@@ -1,3 +1,9 @@
+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-05-13  Peter Bergner  <bergner@vnet.ibm.com>
 
        * doc/sourcebuild.texi: (dfp_hw): Document.
index 99f0657a9cfeeeabad677998a13babdd6a7108ce..0274288387e38b6cf3b442cf61f02fdcf7c0c03d 100644 (file)
@@ -26254,13 +26254,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 2e49912561e93f57b7cf1120c61e2c9682049a02..b9847d38829e3eeb8ed354b794b76ed180cb5279 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-14  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR rtl-optimization/60901
+       * gcc.target/i386/pr60901.c: New test. 
+
 2014-05-14  Yury Gribov  <y.gribov@samsung.com>
 
        PR sanitizer/61100
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);
+    }
+}